Hello! try checking database collation settings / server collation settings.
Mukkie
Posts
-
2005 sql server returns 'Invalid character value for cast specification' -
unsigned char, char, CStringHello! or try this: strcpy(buf, (LPCTSTR)strInput); :)
-
hook & override api functions!!!!!!!!!!!!!!!Hello! Take some time and read: http://research.microsoft.com/sn/detours/ :)
-
Output Box In VC++Hello! As I understand, you want to create docked window in your own application? You can look at: http://www.codeproject.com/docking/prod\_profuis.asp http://www.codeproject.com/wtl/wtldockingwindows.asp :)
-
Attaching Dialogs to Single Document ApplicationsHello! Create new entry in resource editor in menu. By using class wizard create a method which will be called when menu item will be chosen. In this method instantiate dialog class instance, and call DoModal() :)
-
Debugging release versions with dumpsHello! No. You can: 1) debug assembler code (hard thing) 2) use map files (rather easy thing - I have seen somewhere article on that here, on codetools) 3) use horror debugging - call messageboxes everywhere 4) use logging into file, or to some other process 5) turn off optimisation :)
-
Calling DLL from Release/Debug exeHello! "What do you mean by different memory allocators?" In debug build, memory allocator allocates for example guardians (additional bytes before and after allocated block of memory). Guardians are used to detect memory overwrites. Generally, there are a lot of differences between allocating memory in release and debug version. See msdn for more details :)
-
What is the diff between ?Foo@Class and ?FooA@Class in DLL export?Hello! use UndName.Exe and pass full decorated function name to see it's full undecorated name. :)
-
Need ur opinion about C++ vs. PHPHello! C++ is easy :P php is very similar to plain C. C++ is far more complicated in its nature, but you do not have to learn whole language to be able to write something. But for sure, php is simpler subject than c++. :)
-
Calling DLL from Release/Debug exeHello! Most probably (for sure) it is because of different memory allocators in release and debug version. Also, there might be problems with alignment (though I do not suspect that you have different alignment in debug and release). Does it work in both debug and both release? :)
-
to retrieve the address line from explorerHello! Check with Spy. Maybe this edit box has some unique ID? :)
-
Drive TypeTry this: (below code detects dvd)
STORAGE_MEDIA_TYPE GetDriveType(TCHAR A_chletter) { DISK_GEOMETRY Geom[20]; DEVICE_MEDIA_INFO dinfo[20]; DWORD cb; GET_MEDIA_TYPES gmedia[20]; ZeroMemory(Geom, sizeof(Geom)); ZeroMemory(dinfo, sizeof(dinfo)); ZeroMemory(gmedia, sizeof(gmedia)); HANDLE hVolume = NULL; CString drive_argument; drive_argument.Format(_T("\\\\.\\%c:"), A_chletter); //wsprintf(szVolumeName, szVolumeFormat, cDriveLetter); hVolume = CreateFile( (TCHAR*)(LPCTSTR)drive_argument, GENERIC_READ, FILE_SHARE_READ | FILE_SHARE_WRITE, NULL, OPEN_EXISTING, 0, NULL ); if(DeviceIoControl (hVolume, IOCTL_STORAGE_GET_MEDIA_TYPES_EX, 0, 0, gmedia, sizeof(gmedia), &cb, 0)) { UINT MediaCharacteristics = gmedia[0].MediaInfo[0].DeviceSpecific.DiskInfo.MediaCharacteristics; MediaCharacteristics = MediaCharacteristics; CloseHandle(hVolume); if(gmedia[0].DeviceType == FILE_DEVICE_DVD)//FILE_DEVICE_CD_ROM AfxMessageBox("found dvd!"); return (STORAGE_MEDIA_TYPE)(gmedia[0].MediaInfo[0].DeviceSpecific.DiskInfo.MediaType); } CloseHandle(hVolume); return (STORAGE_MEDIA_TYPE)Unknown; }
see _STORAGE_MEDIA_TYPE enumeration type. :) -
source file pathHello! If you get link errors, maybe include source file in project? Simply add it as a existing file to project. :)
-
Need HELP URGENTLY with COleDateTime!!!!!!Hello! - check with dependency viewer what libraries are truly loaded (maybe you have two copies of some dll?) - MSDN says that only formats DD-MM-YYYY MM-DD-YYYY YYYY-MM-DD are properly handled - see VarDateFromStr - maybe instead of ParseDateTime you can use COleDateTime::Format() ? - check the difference in locale settings (control panel) for date/time format on machines where it works, and not. :)
-
to retrieve the address line from explorerHello! Spy retrieves correctly. Maybe this is UNICODE window? :)
-
Oddity Copying Global MemoryHello! GlobalAlloc() returns a "handle to the newly allocated memory object", and this does not mean pointer to allocated memory. So I suspect, that this handle is a pointer to structure, in which one of the field is pointer to memory (only suspission). But: it did not overwrite my stack:
HANDLE hGlobal = GlobalAlloc( GMEM_ZEROINIT, 2048); UINT size=GlobalSize(hGlobal); LPBYTE pBuffer=new BYTE[size]; // Buffer allocation is successful memcpy(pBuffer,hGlobal,size); // <-- Call stack changes in memcpy()
If you want to use memory pointer, take a look at the flag GMEM_FIXED in GlobalAlloc() :) -
can i use two projects in one work space ,, how ???To have two projects in one workspace, simply "add existing project" from context menu on workspace (as I remember). If you want to use the other project, you can import/export some data. In case of socket it will be more difficult, cause you will not be able to debug two projects from one workspace in one vc at once :)
-
Problem in SearchPathSo you should not use SearchPath() Use either SHFindFiles or locate the file by yourself, by traversing directories, and using FindFirstFile, FindNextFile. Search path searches for file in: 1) The directory from which the application loaded. 2) The current directory. 3) The system directory. Use the GetSystemDirectory function to get the path of this directory. 4) The 16-bit system directory. There is no function that retrieves the path of this directory, but it is searched. 5) The Windows directory. Use the GetWindowsDirectory function to get the path of this directory. 6) The directories that are listed in the PATH environment variable. These are not all directories for sure :)
-
How to load Cyrillic strings from resources?use Unicode (define _UNICODE macro and proper entry point for executable). See MSDN for detailed description
-
How can I get the file size of a fileHello! GetFileSize() is WinAPI