Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
G

georgiek50

@georgiek50
About
Posts
224
Topics
87
Shares
0
Groups
0
Followers
0
Following
0

Posts

Recent Best Controversial

  • SendMessage to another dialog window
    G georgiek50

    I see. I'm using Win32. Is there a workaround for this?

    C / C++ / MFC help question

  • SendMessage to another dialog window
    G georgiek50

    Thanks for the reply. I'm quite new at coding and can't quite decipher what you provided, but are you suggesting I subclass the control?

    C / C++ / MFC help question

  • SendMessage to another dialog window
    G georgiek50

    I'm having a problem sending a message from one window to another in my (Win32) application. A little background: 1) It's a dialog based app 2) It consists of a tab control and several child window dialogs I want to send the text of an edit control from one tab/child window to another tab/child window's list box using: SendMessage(hwnd, LB_ADDSTRING, 0, (LPARAM) szString); However I can not get them to communicate. I can't figure this out (never attempted it before). I have a single function handling all messages of each child window of the tab control. Everything works great as long as I'm updating the window/tab in view. Can anyone point me in the right direction? Thanks in advance.

    C / C++ / MFC help question

  • Stuck w/ a simple ReadFile?!!!
    G georgiek50

    That was the problem. Thanks.

    Mobile help question

  • 24 bit DIB has different values on PPC and Desktop PC?
    G georgiek50

    I recently ran into the situation where a bitmap displayed different results for pixels (255, 0, 255 vs. 248, 0, 248) on a desktop PC and a pocket PC. I've looked around for comments on this but haven't found anything. Does anyone have any information as to how this is possible????

    C / C++ / MFC visual-studio graphics question

  • Stuck w/ a simple ReadFile?!!!
    G georgiek50

    I thought I would post this here because I can't spot the error. This is my first attempt to code for a Pocket PC. The following code works fine on the desktop: TCHAR szFilePath[MAX_PATH]; wsprintf(szFilePath, TEXT("%sTest.txt"), this->szAppRootDirectory); HANDLE hFile = CreateFile(szFilePath, GENERIC_READ, 0, NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL); if ( hFile == INVALID_HANDLE_VALUE ) { MessageBox(hwnd, TEXT("Fatal error: Unable to open file."), NULL, MB_OK); return R_ERROR; } DWORD dwBytesRead; DWORD dwFileSize = SetFilePointer(hFile, 0, NULL, FILE_END); TCHAR *szBuffer = new TCHAR[dwFileSize + 1]; SetFilePointer(hFile, 0, NULL, FILE_BEGIN); ReadFile(hFile, szBuffer, dwFileSize, &dwBytesRead, NULL); CloseHandle(hFile); szBuffer[dwFileSize] = '\0'; Unfortunatelly, szBuffer fills w/ garbage (boxes) on the Pocket PC. Can anyone spot the error here? Thanks in advance.

    Mobile help question

  • ShowHTMLDialog working with XP not Win98
    G georgiek50

    CreateURLMoniker returns S_OK. The only reason I know that it is failing at the specific line is that the HRESULT returned by ShowHTMLDialog != S_OK (I have tested all other return values). I guess the most important question from here is to find what error code exactly the function returns. That is what I can't find documentation on. Thanks for the help.

    C / C++ / MFC help question html tutorial announcement

  • ShowHTMLDialog working with XP not Win98
    G georgiek50

    GetLastError() returns 0 and I don't know specifically which function to call to get this type of error (I'm very new to this stuff and can't find it in MSDN) Not working means the dialog isn't opening. The file is there, MSHTML.dll is being loaded as well. Thanks for the help.

    C / C++ / MFC help question html tutorial announcement

  • ShowHTMLDialog working with XP not Win98
    G georgiek50

    I have a small function in my app that displays an HTML dialog that works find in Windows XP but not 98. Code is as follows: void ShowExportTemplatePreview(HWND hwnd) { // Function to show a template export preview in another dialog window HINSTANCE hinstMSHTML = LoadLibrary(TEXT("MSHTML.DLL")); if(hinstMSHTML) { SHOWHTMLDIALOGFN *pfnShowHTMLDialog; pfnShowHTMLDialog = (SHOWHTMLDIALOGFN*) GetProcAddress(hinstMSHTML, TEXT("ShowHTMLDialog")); if(pfnShowHTMLDialog) { char szTemplatePreview[MAX_PATH]; wsprintf(szTemplatePreview, "%s\\Temp_0.html", cStartupData.szAppDirectory); WCHAR wcTemplatePreview[MAX_PATH]; MultiByteToWideChar(CP_THREAD_ACP, NULL, szTemplatePreview, sizeof(szTemplatePreview), wcTemplatePreview, MAX_PATH); IMoniker *pURLMoniker; CreateURLMoniker(NULL, wcTemplatePreview, &pURLMoniker); if (pURLMoniker) { BSTR bstrOptions = SysAllocString(L"dialogHeight:30;dialogWidth:45;resizable:yes"); (*pfnShowHTMLDialog)(hwnd, pURLMoniker, NULL, (char*) bstrOptions, NULL); SysFreeString(bstrOptions); pURLMoniker->Release(); } } FreeLibrary(hinstMSHTML); } } This is mostly copied from MSDN and I am trying to find compatibility issues with no success. We have pinpointed the problem to: (*pfnShowHTMLDialog)(hwnd, pURLMoniker, NULL, (char*) bstrOptions, NULL); But i have no idea as to what is causing the error or how to even go about solving it. Does anyone have any experience with this function that could be of help? Thanks in advance.

    C / C++ / MFC help question html tutorial announcement

  • Help w/ Debugging please
    G georgiek50

    That's the problem...the dialog pops up and then when I hit cancel it takes me to the funny looking assembly code (or whatever it may be)

    C / C++ / MFC c++ help debugging question

  • Help w/ Debugging please
    G georgiek50

    I am trying to debug my app in MS Visual C++ 6.0 and when I come to an unhandled expression I get a dialog that pops up that says: Please enter the path to STRLEN.ASM...all I need to know is which statement is causing the error. Any suggestions?

    C / C++ / MFC c++ help debugging question

  • Proper function declaration to avoid a memory leak
    G georgiek50

    Yep, I was overwriting...thanks for pointing out my stupid mistakes ;P

    C / C++ / MFC question debugging performance

  • Proper function declaration to avoid a memory leak
    G georgiek50

    Exactly: DAMAGE: after normal block (#3604) at (memory address)

    C / C++ / MFC question debugging performance

  • Proper function declaration to avoid a memory leak
    G georgiek50

    I have a function which returns a char* and I am trying to avoid a memory leak. So far it is in this format: char* MyFunction(char *szBuffer) { char *szTmpBuffer = new char[strlen(szBuffer) + 1]; ...function body... return szTmpBuffer; } And it is called somewhat like this: char *szBuffer = MyFunction(szString); but if after I use szBuffer I try to delete it: delete [] szBuffer; I get a Debug Assertion failed...so the question is, what is the proper way to call new within a function then delete the pointer outside of the function w/o causing errors and avoiding memory leaks?

    C / C++ / MFC question debugging performance

  • Simple file I/O is giving me trouble
    G georgiek50

    Thanks for the replies...yes the file is being opened as text...there shouldn't be a premature EOF character in there...but in general, what are my options while keeping this file open as text?

    C / C++ / MFC ios performance question lounge

  • Simple file I/O is giving me trouble
    G georgiek50

    I am trying to read the entire content of a text file with the following code: File.seekg(0, ios::end); long lFileSize = File.tellg(); szFileBuffer = new char[lFileSize + 1]; if ( szFileBuffer == NULL ) { MessageBox(NULL, "There is not enough memory to run this application", NULL, MB_ICONERROR | MB_OK); return 1; } File.seekg(0, ios::beg); File.get(szFileBuffer, lFileSize + 1, EOF); File.close(); The actual filesize is 715KB but the program is only reading 540KB...tellg gives the correct filesize yet get seems to only be getting 540KB...are there any workarounds for this...in general, are there buffer size limitations as far as istream::get is concerned?

    C / C++ / MFC ios performance question lounge

  • Need help w/ a simple recursive function
    G georgiek50

    I'm such an idiot!!! It would help if FindClose cam before RemoveDirectory!!!!!

    C / C++ / MFC help question

  • Need help w/ a simple recursive function
    G georgiek50

    I wrote a function a while back to clean out a directory and all of its contents and tried re-writing the same one tonight but can't seem to get it right. Any chance someone can point out my mistake?short ClearEntireDirectory(char *szDirectory) { // Function to work on a directory until everything is wiped out HANDLE hFile; WIN32_FIND_DATA wfd; if ( SetCurrentDirectory(szDirectory) == 0 ) return 1; hFile = FindFirstFile("*.*", &wfd); while ( FindNextFile(hFile, &wfd) != 0 ) { if ( wfd.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY && strcmp(wfd.cFileName, "..") != 0 && strcmp(wfd.cFileName, ".") != 0 ) { if ( ClearEntireDirectory(wfd.cFileName) == 1 ) return 1; } DeleteFile(wfd.cFileName); } if ( SetCurrentDirectory("..") == 0 ) return 1; if ( RemoveDirectory(szDirectory) == 0 ) return 1; FindClose(hFile); return 0; }
    I keep getting error 32 (ERROR_SHARING_VIOLATION) when I try to ultimatelly remove the directory.

    C / C++ / MFC help question

  • Fastest way to read entire file into memory
    G georgiek50

    Yep, that's exactly what I did, just making sure it's the fastest way. Thanks for the help.

    C / C++ / MFC performance

  • Avoiding a memory leak
    G georgiek50

    hmmm, I just realized that ommitting the brackets only delets the first element...I have a lot of search/replacing to do!!!! Thanks for the help

    C / C++ / MFC performance question
  • Login

  • Don't have an account? Register

  • Login or register to search.
  • First post
    Last post
0
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups