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
S

suninwater

@suninwater
About
Posts
22
Topics
13
Shares
0
Groups
0
Followers
0
Following
0

Posts

Recent Best Controversial

  • Error: _CrtIsValidHeapPointer(pUserData)
    S suninwater

    Hi,guys: I got a serious error when developing a DLL for my teammates' DELPHI application. Any help is appreciated. Environment: Windows2000 AS, VC++6.0SP5. Related code: typedef struct _tag_MyPackage { int len; char *data; }MyPackage; When I got some data, MyPackage *mp = new MyPackage; mp->data = new char[length of the data] memcpy(mp->data, ...); EnterCriticalSection(&m_cs); mylist.pushback(mp); LeaveCriticalSection(&m_cs); When something happens, below code is executed in another thread, EnterCriticalSection(&m_cs); iterator = mylist.begin(); MyPackage *mp = *iterator; memcpy(A_Pointer_Defined_Before, mp->data, mp->len); if (mp != NULL && mp->data != NULL) { delete [](mp->data); delete mp; } mylist.erase(iterator); LeaveCriticalSection(&m_cs); return; My program runs prefectly in much time, but, in some condition it fails at this line. delete [](mp->data); The error message: Program:\work\myapp\test.exe File: dbgheap.c Line:1044 Expression: _CrtIsValidHeapPointer(pUserData) For information on how your program can cause an assertion failure, see the Visual C++ documentation on asserts. (Press Retry to debug the application) And I also found it fails only when the length of data is a bit long, say, 220000bytes. Some other short length such as 100bytes/1000bytes/50000bytes are all successfully performed. Thanks for your patience and any replies.

    C / C++ / MFC c++ help delphi debugging workspace

  • access violation 0xC0000005 when calling func in dll
    S suninwater

    access violation 0xC0000005 when calling func in dll hi,guys: ask for your kind help. thanks in advance. typedef int (WINAPI * _DLL_FOO)(int, char **, int, char **, LPDCL, LPUSERFUNCTIONS); ...... _DLL_FOO m_PFoo; ...... LoadLibrary successfully。 m_PFoo = (_DLL_FOO)GetProcAddress(m_hDll, "Foo"); //successfully 326: retval = (*m_PFoo)(infc, infv, exfc, exfv, m_lpDCL, m_lpUserFunctions); 004440D2 mov esi,esp 004440D4 mov eax,dword ptr [ebp-4] 004440D7 mov ecx,dword ptr [eax+0B8h] 004440DD push ecx 004440DE mov edx,dword ptr [ebp-4] 004440E1 mov eax,dword ptr [edx+0BCh] 004440E7 push eax 004440E8 mov ecx,dword ptr [ebp-10h] 004440EB push ecx 004440EC mov edx,dword ptr [ebp-8] 004440EF push edx 004440F0 mov eax,dword ptr [ebp-14h] 004440F3 push eax 004440F4 mov ecx,dword ptr [ebp-0Ch] 004440F7 push ecx 004440F8 mov edx,dword ptr [ebp-4] 004440FB call dword ptr [edx+0B0h] <== here access violation 0xC0000005 00444101 cmp esi,esp 00444103 call __chkesp (00451fa0) 00444108 mov dword ptr [ebp-11Ch],eax 327: when failure edx+0B0h == 0x009796b0 009796b0:B0 D4 11 02 CD CD CD CD 38 7B 14 00 78 A4 14 00 00 00 11 02 CD CD CD CD 38 7B 14 00 78 A4 14 00 The address of func m_PFoo is 0x0211D4B0, it's all right. What 's the problem with my program and how to fix it ? Thank you very much !

    C / C++ / MFC help tutorial question

  • SetWindowLong indicates blocked thread.
    S suninwater

    SetWindowLong indicates blocked thread. Hi,guys: I got a problem and any response is much appreciated. :-) Environment: windows2000sp4,vc6sp5 92: LONG style = GetWindowLong(m_hwnd, GWL_STYLE); 93: style |= WS_DLGFRAME | WS_THICKFRAME; 94: SetWindowLong(m_hwnd, GWL_STYLE, style); 1000FD13 mov esi,esp 1000FD15 mov eax,dword ptr [ebp-8] 1000FD18 push eax 1000FD19 push 0F0h 1000FD1B mov ecx,dword ptr [ebp-4] 1000FD1E mov edx,dword ptr [ecx+194h] 1000FD24 push edx 1000FD25 call dword ptr [__imp__SetWindowLongA@12 (10090a28)] 1000FD2B cmp esi,esp 1000FD2D call __chkesp (1002cac0) Everything is ok till 1000FD25 call dword ptr [__imp__SetWindowLongA@12 (10090a28)] when single step debugging. The thread seems suspended at this line and never process any more. How can I solve this problem ? Thanks you very much !

    C / C++ / MFC question help workspace

  • IsWindow(m_hwnd) returns 0.
    S suninwater

    thanks for your reply ! :-) 1) CreateWindow succeeds clearly! 2) the window will be available till mainfunc() terminates. more help ?

    C / C++ / MFC help question

  • IsWindow(m_hwnd) returns 0.
    S suninwater

    IsWindow(m_hwnd) returns 0. Hi, guys: I've met a problem that a new thread tests the window handle m_hwnd through IsWindow() but reurns 0. below is related code: ///////////////////////////////////////////// class MyClass { public: HWND m_hwnd; ...... int run(); void * run_undetached(); }; void mainfunc() { ...... MyClass a; a.run(); } int MyClass::run() { ...... m_hwnd = CreateWindow(......); //start the run_undetached() in a new thread here. ...... } void * MyClass::run_undetached() { ...... if ( !IsWindow(m_hwnd)) outputmsg("m_hwnd is not a window!"); } ///////////////////////////////////////////// any comments? TIA

    C / C++ / MFC help question

  • How can a self-extracting file get parameter from html ?
    S suninwater

    How can a self-extracting file get parameter from html ? Hi, guys: I've developed a dll together with several other files and I want to put them onto my website so that anyone visits it will download a self-extracting file, when the download is finished all the files should be extracted into a system directory, say c:\winnt\system\foo, and the indicated main exe file will start automatically. The problem is how can I get some parameters from the html page? The famous PackageForTheWeb can do most work for me but I still do not know anything about the parameters. Thanks for your patience and any help is much appreciating. TIA

    C / C++ / MFC help question html

  • How can a CAB get parameter from html ?
    S suninwater

    How can a CAB get parameter from html ? Hi, guys: I have a CAB which contains a ATL based DLL. My question is How can I get some info from the html page? I know the OBJECT and PARAM tag of html language is helpful to my question. But I don't know how to implement it. Any help or URL is much appreciating. TIA

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

  • AllocConsole fails in release mode.
    S suninwater

    AllocConsole fails in release mode. Hi,guys: I have an ActiveX which includes a Library file (foo.lib). In this foo.lib, a console is created with AllocConsole() function. Everything is OK in the Debug mode. But in the releasemindependency mode, the AllocConsole function fails to create a new console window. The related code is as below: ///////////////////////////// FreeConsole(); AllocConsole(); ///////////////////////////// Any ideas ? TIA -gusd

    C / C++ / MFC com debugging question announcement

  • ActiveX keeps running after closing IE ?
    S suninwater

    Could somebody provide any idea ?

    C / C++ / MFC c++ com tutorial question

  • ActiveX keeps running after closing IE ?
    S suninwater

    ActiveX keeps running after closing IE ? Hi, all: When browsing a web page which contains a CAB incluing DLLs and INF, the content within this CAB are downloaded and started to run. And it stops when IE is closed. How to keep the ActiveX running after closing IE? My ActiveX is a DLL developed with VC ATL. TIA -gusd

    C / C++ / MFC c++ com tutorial question

  • debug mydll.dll works fine, releaseminsize doesn't
    S suninwater

    Hi, guys: I've developed a dll which need several other dll's. It's OK when I "regsvr32 mydll.dll" and it works perfectly. But, the releaseminsize version give me "LoadLibrary(mydll.dll) failed - unspecified error". What's wrong with the releaseminsize version ? How can I get it working? TIA -gusd

    C / C++ / MFC question debugging help announcement

  • How to convert a non-mfc multithreading vc++6.0 win32sdk program to a mfc one ?
    S suninwater

    convert my program to a MFC one then convert the MFC one to an ocx. He also told me the first step need only minor change on source and the latter is also not very difficult. Time is so limited though I'm not familiar with VC++... Can you give me some further help? Thank you very much !

    C / C++ / MFC c++ tutorial question

  • How to convert a non-mfc multithreading vc++6.0 win32sdk program to a mfc one ?
    S suninwater

    What a pity! Are there any other ways in which I can finish my task ? Thanks a lot for your help anyway!

    C / C++ / MFC c++ tutorial question

  • How to convert a non-mfc multithreading vc++6.0 win32sdk program to a mfc one ?
    S suninwater

    Thanks for your kind and clear direction. But my program is not a simple SDI/MDI/Dialog one, instead, something more complex. Does your solution fit this ? Thank you very much !

    C / C++ / MFC c++ tutorial question

  • How to convert a non-mfc multithreading vc++6.0 win32sdk program to a mfc one ?
    S suninwater

    I have to convert my program to an ocx. And I've got that it's very difficult to implement it from a win32 one. Somebody told me it's a little easier to do that from a mfc one. Am I right or wrong ? Any advice ?

    C / C++ / MFC c++ tutorial question

  • How to convert a non-mfc multithreading vc++6.0 win32sdk program to a mfc one ?
    S suninwater

    Hi, guys: How to convert a non-mfc multithreading vc++6.0 win32sdk program to a mfc one ? Any suggestion/advice is much appreciated. TIA :confused:

    C / C++ / MFC c++ tutorial question

  • include error
    S suninwater

    Thanks any way. :-)

    C / C++ / MFC help c++ learning

  • include error
    S suninwater

    Thanks for your advice. But, I'm wondering whether there's some path variable in the foo.dsp file or not. do you know that ?

    C / C++ / MFC help c++ learning

  • include error
    S suninwater

    I'm going to convert a program to a library. First, I delete the project(say foo.dsp) which originally create binary exe-file. Second, insert all header/cpp/resource files which are in foo.dsp into the new one.Third, compile to see how thing's going. To my surprise, many include path errors come out to me. PS: preprocesser definitions are always the same. Please give me some help if you could. TIA -gusd

    C / C++ / MFC help c++ learning

  • performance disaster after removing myhook.dll
    S suninwater

    OK, as your word, I've replace "cut off" with "remove". Sorry. And, can you give me some help ?

    C / C++ / MFC help c++ design 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