How to obtain the user login documents folder in C++
TCHAR strPath[ MAX_PATH ];
// Get the special folder path.
SHGetSpecialFolderPath(
0, // Hwnd
strPath, // String buffer.
CSIDL_PERSONAL, // CSLID of folder
FALSE ); // Create if doesn't exists?
Day to day work issues we find with windows, mac, unix and internet, software apps etc. we get many many questions and find out some weird things tips and tricks about windows OS that might help others, some of these will help others and help our clients setup software to there requirements.
Saturday, 28 May 2011
How to create a PFX Certificate file from PVK and SPC files.
download the latest Windows 7.1 sdk from Microsoft and use pvk2pfx.exe
http://www.microsoft.com/downloads/en/details.aspx?FamilyID=6b6c21d2-2006-4afa-9702-529fa782d63b&displaylang=en
download the winsdk_web.exe (498k) and when installing select Windows Native Code Development --> Tools
In dos:-
CD "C:\Program Files\Microsoft SDKs\Windows\v7.1\Bin"
pvk2pfx -pvk c:\mykey.pvk -spc c:\mykey.spc -pfx c:\mykey.pfx
you will need to enter your PVK creation password when prompted.
http://www.microsoft.com/downloads/en/details.aspx?FamilyID=6b6c21d2-2006-4afa-9702-529fa782d63b&displaylang=en
download the winsdk_web.exe (498k) and when installing select Windows Native Code Development --> Tools
In dos:-
CD "C:\Program Files\Microsoft SDKs\Windows\v7.1\Bin"
pvk2pfx -pvk c:\mykey.pvk -spc c:\mykey.spc -pfx c:\mykey.pfx
you will need to enter your PVK creation password when prompted.
Tuesday, 17 May 2011
SendMail Socket crash on second email from Acrobat plugin app fix
In your project settings: C/C++ tab, Preprocessor Definitions add: _USRDLL to fix the problem.
possibly todo with a bug in Visual C++ - see: http://support.microsoft.com/kb/166817
possibly todo with a bug in Visual C++ - see: http://support.microsoft.com/kb/166817
Monday, 16 May 2011
Modless Dialog not launching from Acrobat ADM plugin application - error at line 21
In your first initilization dialog prompt add the following lines:
extern "C" HINSTANCE gHINSTANCE;
extern "C" HWND gHWND;
AfxSetResourceHandle(gHINSTANCE);
gHINSTANCE can be found in Pimain.cpp
extern "C" HINSTANCE gHINSTANCE;
extern "C" HWND gHWND;
AfxSetResourceHandle(gHINSTANCE);
gHINSTANCE can be found in Pimain.cpp
Tuesday, 10 May 2011
Drag and Drop not dropping in expected order issue
This is a general windows feature - the issue is where the mouse pointer is when you click to drag, make sure you have the mouse pointer at the very top of the list to drag so it will retain them in order on screen.
Sunday, 8 May 2011
Drag and Drop been blocked / not working in Vista and Windows 7 C++ fix in VS6 (Visual studio 6)
This is a problem with permissions in Vista and Win7 that was introduced with UAC control, there is a workaround but most are using VS2005, 2010 to get around it - to get around it in VS6 call the .dll routine directly by doing below in the startup of your app
Change the startup of your app:-
BOOL C<yourappname>App::InitInstance()
{
AfxEnableControlContainer();
------------------------------------------------------------------------------
To:-
#define MSGFLT_ADD 1
extern "C" BOOL ( STDAPICALLTYPE *pChangeWindowMessageFilter )( UINT,DWORD ) = NULL;
BOOL C<yourappname>App::InitInstance()
{
AfxEnableControlContainer();
// fix drag and drop issue in Windows Vista and Windows 7
HMODULE hMod = 0;
if ( ( hMod = ::LoadLibrary( _T( "user32.dll" ) ) ) != 0 )
{
pChangeWindowMessageFilter = (BOOL (__stdcall *)( UINT,DWORD ) )::GetProcAddress( hMod, "ChangeWindowMessageFilter" );
}
if ( pChangeWindowMessageFilter )
{
pChangeWindowMessageFilter (WM_DROPFILES, MSGFLT_ADD);
pChangeWindowMessageFilter (WM_COPYDATA, MSGFLT_ADD);
pChangeWindowMessageFilter (0x0049, MSGFLT_ADD);
}
Change the startup of your app:-
BOOL C<yourappname>App::InitInstance()
{
AfxEnableControlContainer();
------------------------------------------------------------------------------
To:-
#define MSGFLT_ADD 1
extern "C" BOOL ( STDAPICALLTYPE *pChangeWindowMessageFilter )( UINT,DWORD ) = NULL;
BOOL C<yourappname>App::InitInstance()
{
AfxEnableControlContainer();
// fix drag and drop issue in Windows Vista and Windows 7
HMODULE hMod = 0;
if ( ( hMod = ::LoadLibrary( _T( "user32.dll" ) ) ) != 0 )
{
pChangeWindowMessageFilter = (BOOL (__stdcall *)( UINT,DWORD ) )::GetProcAddress( hMod, "ChangeWindowMessageFilter" );
}
if ( pChangeWindowMessageFilter )
{
pChangeWindowMessageFilter (WM_DROPFILES, MSGFLT_ADD);
pChangeWindowMessageFilter (WM_COPYDATA, MSGFLT_ADD);
pChangeWindowMessageFilter (0x0049, MSGFLT_ADD);
}
Saturday, 7 May 2011
ASUS PL-X31 data over mains fix from slowness and droping out
Found an issue with Panasonic phone mains adapter causing interference with ASUS PL-X31 data over mains, moved it to another location and now is fine.
Wednesday, 4 May 2011
Batch & Print Pro IMG Addon - header footer [FITLETITLE] not changing.
header and footers are defaulted to [FILETITLE] this can cause complications when running from the command line as -h -f need to be blanked out.
so we've revised it for next version 1.13 release to be nothing in those fields.
download revised 1.12 version here:
http://www.traction-software.co.uk/beta/bppimgaddon.zip
so we've revised it for next version 1.13 release to be nothing in those fields.
download revised 1.12 version here:
http://www.traction-software.co.uk/beta/bppimgaddon.zip
COM Component invalid Class fix on .asp server scripts - security issue
COM Component invalid Class fix on .asp server scripts
This is a new windows security feature which was introduced in XP sp3 and latest Vista, Windows 7 & 2008.
NOTE: PDFTextStamp.PDFTextStampCom.1 is an example name of your COM component.
find HKEY_CLASSES_ROOT\PDFTextStamp.PDFTextStampCom.1
right mouse on it and select 'permisions...'
click Add... button
IUSR_<computer name>
click 'Full control' for permissions
then you should be ok... this is a new windows security feature which was introduced in XP sp3 and latest Vista, Windows 7 & 2008.
This is a new windows security feature which was introduced in XP sp3 and latest Vista, Windows 7 & 2008.
NOTE: PDFTextStamp.PDFTextStampCom.1 is an example name of your COM component.
find HKEY_CLASSES_ROOT\PDFTextStamp.PDFTextStampCom.1
right mouse on it and select 'permisions...'
click Add... button
IUSR_<computer name>
click 'Full control' for permissions
then you should be ok... this is a new windows security feature which was introduced in XP sp3 and latest Vista, Windows 7 & 2008.
Windows quick find file / folder / item tip
Not many people know this but there is a quick way to find files / folders / items in a directory and this can also be used with other list view windows and comobo boxes.
when looking for something highlight the first item or an item (file / folder) near the one your looking for, then start typing the name e.g. to find SchoolBooks
press S, it will jump straight to the S'es in the list then if you quickly do e.g. sc it will go straight to it.
when looking for something highlight the first item or an item (file / folder) near the one your looking for, then start typing the name e.g. to find SchoolBooks
press S, it will jump straight to the S'es in the list then if you quickly do e.g. sc it will go straight to it.
Adobe ADM -32767 to 32768 range on numbers int issue
How to fix this issue with the Int variable range that is preset.
itemRef = sADMDialog->GetItem(promptDialog, IDC_EDIT_STARTFROM);
sADMItem->SetUnits(itemRef, kADMNoUnits);
sADMItem->SetMaxIntValue(itemRef,999999); // **** this is required
sADMItem->SetIntValue(itemRef,atoi(token));
itemRef = sADMDialog->GetItem(promptDialog, IDC_EDIT_STARTFROM);
sADMItem->SetUnits(itemRef, kADMNoUnits);
sADMItem->SetMaxIntValue(itemRef,999999); // **** this is required
sADMItem->SetIntValue(itemRef,atoi(token));
Mac - Keyboard keys for startup and other things... usefull.
On Boot
| Key Combination | Effect |
|---|---|
| mouse down | Eject removable media ( I think Boot ROMs prior to 2.4f1 excluded the CD drive ) |
| opt | Bring up OF system picker on New World machines - boot to 9 on pre-New World machines |
| F8 | Bring up Mac OS X boot partition selector (DTKs only?) |
| cmd-period | When OF system picker is active, open the CD tray |
| cmd-opt | Hold down until 2nd chime, will boot into Mac OS 9 ? |
| cmd-x (or just x?) | Will boot into Mac OS X if 9 and X are on the same partition and that’s the partition you’re booting from. |
| cmd-opt-n-d | prevent native drivers from loading (System 7 until 9.x?) |
| cmd-opt-shift-delete | Bypass startup drive and boot from external (or CD). This actually forces the system to NOT load the driver for the default volume, which has the side effect mentioned above. For SCSI devices it searches from highest ID to lowest for a partition with a bootable system. Not sure about IDE drives. |
| cmd-opt-shift-delete-# | Boot from a specific SCSI ID # (# = SCSI ID number) |
| cmd-opt-p-r | Zap PRAM. Hold down until second chime. |
| cmd-opt-n-v | Clear NV RAM. Similar to reset-all in Open Firmware. |
| cmd-opt-o-f | Boot into open firmware |
| cmd-opt-t-v | Force Quadra AV machines to use TV as a monitor |
| cmd-opt-x-o | Boot from ROM (Mac Classic only) |
| cmd-opt-a-v | Force an AV monitor to be recognized as one |
| c | Boot from CD. If set to boot to X and no CD is present, may boot to 9. |
| d | Force the internal hard disk to be the startup device |
| n | Hold down until Mac logo, will attempt to boot from network server (using BOOTP or TFTP) |
| r | Force PowerBooks to reset the screen |
| t | Put FireWire machine into FireWire Target Disk mode |
| z | Attempt to boot using the devalias zip from first bootable partition found |
| ctl-cmd-shift-power | Reset power manager (with computer off) |
| shift | (Classic only) Disable Extensions |
| shift | (OS X, 10.1.3 and later) Disables login items. Also disables non-essential kernel extensions (safe boot mode) |
| cmd | (Classic only) Boot with Virtual Memory off |
| cmd-v | (OS X only) show console messages (verbose mose) during boot. Also invokes Safe Mode |
| cmd-s | (OS X only) boot into single user mode |
| cmd-opt-c-i | (Mac IIci only) Set date to 20 Sep 1989 to get a graphical easter egg |
| cmd-opt-f-x | (Mac IIfx only) Set date to 19 Mar 1990 to get a graphical easter egg |
| cmd-opt-shift-tab-delete | Erase startup disk under 7.1(?) |
After display of Happy Mac icon
| Key Combination | Effect |
|---|---|
| space | (Classic only) Invoke Extensions Manager |
| shift | (Classic only) Disable Extensions including MacsBug |
| shift-opt | (Classic only) Disable exetensions, except MacsBug |
| ctrl | (Classic only) Break into MacsBug as soon as it is loaded |
As Finder Starts
| Key Combination | Effect |
|---|---|
| cmd-opt | (whenever Classic Finder sees a new disk) Rebuild Desktop |
| opt | (Mac OS 9) Do not open Finder windows |
| shift | (Mac OS X) Do not launch startup items. Do not open Finder windows when launching Finder. The windows’ states aren’t changed to closed, as they will be reopened if you reboot again. |
| shift | (Mac OS 9) Do not launch anything from the "Startup Items" folder. |
In Finder
| opt-click close box (or cmd-opt-w) | Close all open finder windows (except popup windows) |
| cmd-shift-opt-w | Close all open finder windows (including popup windows) |
| cmd-right arrow | Open folder in list view |
| cmd-opt-right arrow | Recursively open folder and nested folders in list view |
| cmd-left arrow | Close folder in list view |
| cmd-opt-left arrow | Recursively close folder and nested folders in list view |
| cmd-up arrow | Open parent folder. On Mac OS X, when nothing is selected and no windows are open, open User directory |
| cmd-opt-up arrow | Open parent folder, closing current folder |
| cmd-opt-shift-up arrow | Make desktop the active window, select parent volume |
| cmd-down arrow | Open selected item. On Mac OS X, when nothing is selected and no windows are open, open the desktop folder |
| cmd-opt-down arrow | Open selected item, closing current folder |
| cmd-opt-o | Open selected item, closing current folder |
| opt-double-click | Open selected item, closing current folder |
| opt-click | (In disclosure triangle) expand or collapse all folders within that window |
| tab | select next icon alphabetically |
| shift-tab | select previous item alphabetically |
| cmd-delete | move selection to trash |
| cmd-shift-delete | empty trash |
| space | while navigating, opens folder under mouse immediately (with spring-loaded folders enabled) |
| In Finder Window Menu | |
| cmd-select | Close window |
| cmd-shift-select | Put away popup window |
| cmd-opt-select | Expand selected window and close all others |
| ctl-select | Expand selected window and collapse all others |
| ctl-opt-select | Activate selected window and expand all others |
On disk mount
| cmd-opt | (whenever Classic Finder sees a new disk) Rebuild Desktop |
| opt | (Mac OS 9) Add session numbers (;1, ;2, etc) to ISO-9660 CD filenames |
| opt | (Mac OS X) Show each session on an ISO-9660 CD as a volume |
| cmd-opt-i | Force-mount ISO-9660 partition of a CD, rather than a Mac partition |
After startup
| Key Combination | Effect |
|---|---|
| On machines with a power key | |
| power | Bring up dialog for shutdown, sleep or restart (see next table) |
| cmd-ctrl-power | Unconditionally reboot (sometimes referred to as “control flower power” to easily remember) (dirty reboot - may corrupt disk) |
| ctrl-cmd-opt-power | Fast shutdown |
| cmd-power | Bring up debugger (if debugger installed). Really old macs (mac ii era) needed Paul Mercer’s debugger init to do this, then it got folded into the firmware, around 040 timeframe. |
| cmd-opt-power | Put late model PowerBooks & Desktops to sleep |
| cmd-opt-ctrl-power | (PowerBook 500) Reset Power Manager |
| shift-fn-ctrl-power | (PowerBook G3, G4) Reset Power Manager |
| On machines without a power key | |
| ctrl-eject | Bring up dialog for shutdown, sleep or restart (see next table) |
| cmd-ctrl-eject | Unconditionally reboot |
| ctrl-cmd-opt-eject | Fast shutdown |
| cmd-eject | Bring up debugger (if debugger installed). Really old macs (mac ii era) needed Paul Mercer’s debugger init to do this, then it got folded into the firmware, around 040 timeframe. |
| cmd-opt-eject | Put late model PowerBooks & Desktops to sleep |
| On all machines | |
| cmd-opt-esc | Force quit current app |
| cmd-shift-0 | Put late model PowerBooks & Desktops to sleep No longer work in OS X. On Macs with three floppy drives (Mac SE) they eject the third floppy disk. |
| cmd-shift-1 or 2 | Eject internal or external floppy. Not sure which is which on dual floppy machines (Mac SE, Mac II, etc.) |
| cmd-shift-3 | Screen shot |
| cmd-shift-4 | Abstract user defined area screen shot (hold control while selecting to direct it to the clipboard on Mac OS 9) |
| cmd-shift-capslock-4 | (Classic only) User selectable window screen shot |
| cmd-ctl-shift-3 | Screen shot to clipboard |
| cmd-ctl-shift-4 | Abstract user defined area screen shot to clipboard |
| cmd-ctl-shift-capslock-4 | (Classic only) User selectable window screen shot to clipboard (classic only) |
| cmd-tab | Switch apps (possible to change key in Mac OS 8-9) |
| cmd-shift-tab | Switch apps in reverse order |
| cmd-space | Switch keyboards/script systems (if more than one is installed) |
| cmd-opt-space | switch through all keyboards in keyboards menu |
| opt-f3, opt-f4 or opt-f5 | bring up the system preferences (Mac OS X only - maybe powerbooks only? only if system preferences isn’t already running) |
| cmd-f1 | toggle between video mirroring and extended desktop mode (works on Ti Powerbooks) |
| opt-f1 | open the displays preference (10.2 and later) |
| cmd-f2 | auto-detect a newly-connected display (works on Ti Powerbooks) |
| opt-f2 | open the displays preference (10.2 and later) |
| opt-f3, f4, or f5 | open the Sounds preference (10.2 and later) |
| opt-f8, f9, or f10 | open the Keyboard and Mouse preference (10.2 and later) |
| f12 | Eject CD/DVD (must be held down on 10.1.2 or later). If the device can be dismounted, it is. If not, nothing happens. |
| f14 | dim display (cubes/g4 iMacs/others?) |
| f15 | brighten display (cubes/g4 iMacs/others?) |
| cmd-ctl-shift-0 | Spin down HD (when possible) on machines running OS 9 |
| cmd-` | cycle through current application’s windows (Mac OS X 10.2 only?) |
| cmd-~ | cycle through current application’s windows (reverse order) (Mac OS X 10.2 only?) |
| opt-"Empty Trash" | Emptry trash without locked file or contents summary alert. Empties locked items, as well |
| cmd-opt-D | (Mac OS X only) toggle dock |
| cmd-opt (when opening chooser) | (Mac OS 9 only) rebuild chooser cache of printer driver information |
| (See Universal Access System Preference for more on following) | |
| cmd-opt-ctl-8 | (Mac OS X, 10.2 or later) Turn on "Inverse Mode" via accessbility. |
| cmd-opt-8 | (Mac OS X, 10.2 or later) Turn on "Zoom Mode" via accessbility. |
| cmd-opt-plus | (Mac OS X, 10.2 or later) Zoom In via accessbility. |
| cmd-opt-minus | (Mac OS X, 10.2 or later) Zoom Out via accessbility. |
In the sleep/restart dialog
| Key | Effect |
|---|---|
| S | Sleep |
| R | Restart |
| esc | cancel |
| cmd-. (period) | cancel |
| Return or Enter | Shut Down |
| Power | Cancel (9.2.x only?) |
In other dialogs
| Key | Action |
|---|---|
| esc | Cancel |
| command-. (period) | Cancel |
| enter | Default button |
| return | Default button (if there are no text fields that use return |
| cmd-d | Don’t save (in save/cancel/don’t save dialog) |
| cmd-r | Replace (in "Do you want to replace this file" dialog, Mac OS X only) |
On keyboards with a function key
| Key Combination | Effect |
|---|---|
| fn-backspace | forward delete |
| fn-left arrow | home |
| fn-right arrow | end |
| fn-up arrow | page up |
| fn-down arrow | page down |
Clicks
| click / modifier | Effect |
|---|---|
| option-click in another application | Switch to that application and hide previous app |
| cmd-drag (window) | Drag window without bringing it to front (requires application support to work behind dialogs) |
| cmd-drag (window background) | Pan contents of window with hand (Finder) |
| cmd-opt-drag (window background) | Option may be needed to pan contents of window with hand (Finder) on 10.3 and later |
| cmd-drag (Mac OS X) | Rearrange menu extras |
| opt-drag (file) | Copy file |
| cmd-opt-drag (file) | Make alias of file |
| cmd-click window title | Pop-up menu showing path to current folder/document (in some applications) |
| option-windowshade | Windowshade all windows of application (classic only) |
| option-zoom | Zoom window to full-screen |
| option-yellow | Dock all windows of application (Mac OS X only) |
| option-green | Zoom window to fill screen (in some applications) |
| Mac OS X only - items in dock | |
| cmd-click | Reveal in Finder |
| cmd-opt-click | Activate app and hide other apps |
| ctl-click (or click and hold) | contextual menu |
| cmd-drag into dock | Freeze current dock items from moving so icon can be dropped onto an app |
| cmd-opt-drag into dock | Force application you’re dropping onto to open dropped item |
Mac issues again - Code Warrior 7 compiler error (invalid data in pre compiled header)
Oh we love Macs, reminds me why we consentrate on windows these days.
Problem compiling old PDF Page Numberer for Mac Acrobat 5&6 to change the number limits on start, end boxes etc.
Kept getting error:-
invalid data in pre compiled header no matter what at the start of every .cpp file.
tried a C example in code warrior 7 and worked ok, then tried a C++ one and got the same issue.
Finally found the CodeWarrior 7 CD and re-installed on a new drive then it worked straight away! wow!
Problem compiling old PDF Page Numberer for Mac Acrobat 5&6 to change the number limits on start, end boxes etc.
Kept getting error:-
invalid data in pre compiled header no matter what at the start of every .cpp file.
tried a C example in code warrior 7 and worked ok, then tried a C++ one and got the same issue.
Finally found the CodeWarrior 7 CD and re-installed on a new drive then it worked straight away! wow!
Apple Mac startup issue - monitor hertz too high to view on monitor
Ok, had an issue yestersay - old version of MAC OSX wouldn't startup on our new ViewSonic monitor due to too high hz resolution (90hz x 75hz), after a few reboots trying to telnet in to change the config startup file found that if you startup in SAFE mode then it will get past it so you can then change the settings to 60hz for the monitor graphic display in System Preferences.
To statup in safemode:
To start up into Safe Mode (to Safe Boot), do this:
To leave Safe Mode, restart the computer normally, without holding any keys during startup.
To statup in safemode:
To start up into Safe Mode (to Safe Boot), do this:
- Be sure your Mac is shut down.
- Press the power button.
- Immediately after you hear the startup tone, hold the Shift key. The Shift key should be held as soon as possible after the startup tone, but not before the tone.
- Release the Shift key when you see the gray Apple icon and the progress indicator (looks like a spinning gear).
To leave Safe Mode, restart the computer normally, without holding any keys during startup.
Subscribe to:
Posts (Atom)