|
Is it possible one or more pieces might have been missed in the UNICODE conversion?
Another issue might be string sizes, possibly in your _MODULE_MTYPE_USER_DATA structure. If one of the DLL's has that structure with _TCHAR arrays for strings, and the other has char arrays, that would make the structures different sizes, causing all sorts of Bad Things to happen due to buffer overruns.
Did you redeclare your strings as arrays of _TCHAR 's, or do you use CString 's everywhere?
|
|
|
|
|
It's possible that I missed to redeclare some of the char s to TCHAR s and messed up the sizing. Thanks for the tip, I'll have to check on that. But I don't understand why the GetModuleFileName casues an assetion when AFX_MANAGE_STATE(AfxGetStaticModuleState()) is used. As far as I can see that error shouldn't depend on any TCHAR/char mismatch.
Cctm::Cctm(void)
:m_lock("Cctm::lock")
{
AFX_MANAGE_STATE(AfxGetStaticModuleState());
m_initialized=FALSE;
m_session=NULL;
m_sModuleStatus[0]=0;
m_iApprovedModuleStatus = 0;
m_sActivityStatus[0]=0;
m_iApprovedActivityStatus = 0;
m_showCode=TRUE;
m_moduleTypes=NULL;
m_usedDisplayMasks=0;
m_dbinfo=NULL;
std_functions_init();
HINSTANCE l = afxCurrentResourceHandle;
CString sFile;
GetModuleFileName(AfxGetResourceHandle(), sFile.GetBuffer(_MAX_PATH + 1), _MAX_PATH);
Or could it have something to do with the sFile.GetBuffer(_MAX_PATH + 1) ? Could that cause some wierd behaviout now when it's unicode?
|
|
|
|
|
The other possibility is the AfxGetResourceHandle() call. Have you tried stepping into the method with the debugger?
|
|
|
|
|
I tried to do that, I have a vague memory that I've managed to that before, but now the debugger couldn't find any source code, so I had to go to disassembly. Anyway, I managed to figure out that it uses afxCurrentResourceHandle , and when I use it in my code it return null, and thats probably why AfxGetResourceHandle() causes assrt failure.
Isn't AFX_MANAGE_STATE(AfxGetStaticModuleState()) supposed to set me to the right resource?
Do you know how can I get the handle to be a valid handle to my dll?
|
|
|
|
|
It sounds like one or more of your DLL's are release compiles. In order for you to debug into them, they all need to be debug builds.
|
|
|
|
|
hmm...no, my Dlls are debug builds, but in that case it seems like the debugger can't find the MFC debug dlls where GetModuleFileName and AfxGetResourceHandle() is. Is there some sort of wierd switch? except for _DEBUG?
|
|
|
|
|
finally found something.
Seems like this code is causing the assertion:
_AFXWIN_INLINE HINSTANCE AFXAPI AfxGetResourceHandle()
{ ASSERT(afxCurrentResourceHandle != NULL);
return afxCurrentResourceHandle; }
Seems like afxCurrentResourceHandle haven't been properly set. I thought that was what AFX_MANAGE_STATE(AfxGetStaticModuleState()) was doing. You wouldn't happen to know any reason why it would fail?
|
|
|
|
|
Not off hand, I'm afraid.
If you are creating MFC extension DLL's, then that might be a problem. Try looking that up on MSDN.
|
|
|
|
|
Slolved it. It was a stupid lib file I used that had to be unicode compiled as well. Didn't notice it because the compiler didn't complain.
Thanks for your help.
|
|
|
|
|
I had problem in migrating from VC6 to VC2005
typedef _A::size_type size_type; works fine in the vc 6 and flashes the below error after migrating to VC 2005
"thirdparty\dinkumpatches\xstring(39) : error C2146: syntax error : missing ';' before identifier 'size_type'"
pls advice
|
|
|
|
|
ptr_Electron wrote: pls advice
My advice is that if you are going to use third party libraries then contact the vendor for support rather than posting messages in a forum.
led mike
|
|
|
|
|
how to do an ordinary operation of disabling an edit controlbox when we chose a radiobutton,iam not able to acess the radiobutton using their variables,how to make the onclick event in radiobuttons,and iam working on visualstudio2005
Raja
|
|
|
|
|
Open the Resource Editor and click the radio button, Visual Studio will write the OnClick code skeleton for you.
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
|
|
|
|
|
REPOST[^]
what's wrong with the answers you got there ?
|
|
|
|
|
Mohanraj D wrote: how to do an ordinary operation of disabling an edit controlbox...
Why are you reposting?
Use EnableWindow(FALSE) .
"Love people and use things, not love things and use people." - Unknown
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
I think you asked and I told you m_Edit.EnableWindow(1 or 0); if you have a variable for editbox.
|
|
|
|
|
Hamid. wrote: I think you asked...
I asked nothing.
"Love people and use things, not love things and use people." - Unknown
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
Oh I am agree with you it was a reply to Mohanraj D,sorry.
|
|
|
|
|
I think you asked and I told you m_Edit.EnableWindow(1 or 0); if you have a variable for editbox,right?
|
|
|
|
|
thankyou...the code worked
Raja
|
|
|
|
|
You're welcome.
|
|
|
|
|
Hello,
How can i read content of richedit control?GetwindowText function is returning windows caption not the content.
Br
Bilgekaan
|
|
|
|
|
Rich Edit control as a caption?
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
|
|
|
|
|
No.I just want to grab richedit control content.CEdit control content can be taken using GetWindowText function.This function "when used for richedit ctrl" is returning caption of richedit control not the content.
|
|
|
|
|
AFAIK Edit Control has NO caption.
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
|
|
|
|