|
The thing about CDynLinkLibrary is that it's created like this, right? :
<br />
new CDynLinkLibrary(TrymfcdefDLL);<br />
Without assigning it to anything. And MFC knows to kill it when DLL is about to be unloaded, right?
And each MFC extension DLL has this, right? Well. In my DLLd dtors deffinitely get called. Cause I've replaced CDynLinkLibrary with my own CDynLinkLibrary derived class and ctor and dtor TRACE to output. So there are some other DLLs that have a problem I assume.
Do you know by any chance if latest is compatible with VC6? Cause I still have my projects there. I want to go VC 7 but, our management doesn't like to take such steps in a hurry.
|
|
|
|
|
I don't know how CDynLinkLibraries are deleted, but if they register themselves to a global list, they will indeed be deleted automatically. It's easy to check, however. Put a breakpoint in one of the working DLL dtor s, and look at the callstack when it is triggered. This will allow you to trace backwards, and might give an indication why the leaking ones don't get delete d.
As for Boundschecker, a quick check on the net shows that Boundschecker 7.1 supports MSVC++ 6.0. Personally, I won't upgrade to VC 7 until the clamour over how crappy it is in microsoft.public.vc.mfc dies down
|
|
|
|
|
I'm trying to attach a bitmap to a button using subclassing in win32 vc++.Can anyone help
|
|
|
|
|
Anonymous wrote:
Can anyone help
That is very likely. However you must first accurately describe the problem.
"No matter where you go, there your are." - Buckaroo Banzai
-pete
|
|
|
|
|
In addition to palbano's post, you might also want to provide the snippet of code that is not working. It'll make suggestions a lot more meaningful.
"When I was born I was so surprised that I didn't talk for a year and a half." - Gracie Allen
|
|
|
|
|
Hi everyone,
I wanted to know about the connection string for connecting to an Oracle database that is not registered in the system DSN.
For example, for connecting to SQL Server I use:
"DRIVER={SQL Server};SERVER=xp01;UID=user;PWD=pass;APP=Generic32;DATABASE=SOMEDATABASE";
However, I cannot figure out the connection string for an Oracle database. I always have to use a DSN.
Can someone help me out with it?
Thanks,
Sincerely,
Pankaj
Without struggle, there is no progress
|
|
|
|
|
This article[^] has an example connection string for most DBs including Oracle.
Michael
CP Blog [^]
|
|
|
|
|
Perfect! Thanks a lot for pointing that one out.
CP is amazing
Sincerely,
Pankaj
Without struggle, there is no progress
|
|
|
|
|
I should know this by now, but what variable is 16 bytes, and which one is 64 bits?
thanks
wWw.KruncherInc.com - My cool programs
|
|
|
|
|
Do you mean 16 bytes or bits?
16-bit is a short int.
Are you looking for a 64-bit integer? If so, use __int64. Just remember it's Microsoft specific though.
Jeremy Falcon
|
|
|
|
|
I'm trying to read the ".lnk" header, I found the specs here http://myfileformats.com/download.php?url=/files/shortcut.zip&id=5870&name=LNK
under "The File Header" Im looking at
offset 4h contents GUID of shortcut files
offset 1Ch contents Time 1
offset 24h contents Time 2
offset 2Ch Contents Time 3
wWw.KruncherInc.com - My cool programs
|
|
|
|
|
I'm not exactly sure what you are asking.
offset 4h contents GUID of shortcut files is 24 bytes in length
offset 1Ch contents Time 1 is 8 bytes in length
offset 24h contents Time 2 is 8 bytes in length
offset 2Ch Contents Time 3 is presumably 8 bytes in length
A char is one byte. A short is 2 bytes. A long is 4 bytes. An int is the same size as the system word (4 bytes in 32-bit OSs).
"When I was born I was so surprised that I didn't talk for a year and a half." - Gracie Allen
|
|
|
|
|
LOL fine, what is a 64 bit int in C? Not platform specific?
|
|
|
|
|
KingKruncher wrote:
what is a 64 bit int in C?
long long , but not all compilers support it.
Ryan "Punctuality is only a virtue for those who aren't smart enough to think of good excuses for being late" John Nichol "Point Of Impact"
|
|
|
|
|
A Microsoft-specific __int64 type exists.
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vclang/html/_langref___int8.2c_.__int16.2c_.__int32.2c_.__int64.asp
"When I was born I was so surprised that I didn't talk for a year and a half." - Gracie Allen
|
|
|
|
|
I've an application written in MFC. The main window is a subclass of CFrameWnd . I'd like to have an option to set the window always-on-top, so I've got a check menu item "Always on top" on my "View" menu. The command handler for this (method OnAlwaysOnTop ) checks the state of the menu item check, toggles it (this works fine) then calls this->ModifyStyleEx( 0, WS_EX_TOPMOST ) or this->ModifyStyleEx( WS_EX_TOPMOST, 0 ) depending on whether it is setting or clearing the state respectively. For some reason I always get a zero return from ModifyStyleEx() meaning it has failed (non-zero means success) and the window does not go topmost.
- Can a CFrameWnd (or a derived class) have the WS_EX_TOPMOST extended style set?
- Does the WS_EX_TOPMOST extended style actually mean always-on-top or does it simply bring to front until another window is activated?
- The window is created using Create() , in order to use extended styles must I use CreateEx() ?
In the debugger this is definetly the correct derived class.
Any tips on how I can achieve this feature?
Thanks all in advance. Please ask if I have been unclear on anything or you need more information.
Cheers,
Robin
|
|
|
|
|
Look at SetWindowPos()
"No matter where you go, there your are." - Buckaroo Banzai
-pete
|
|
|
|
|
Works a charm, I used:
SetWindowPos( &wndTopMost, 0, 0, 0, 0, SWP_NOMOVE | SWP_NOSIZE );
Thanks a lot
|
|
|
|
|
I know what you will say: There are some sources on this site....
all I find was in MFC,
Here is my probleme:
if I do this:
case WM_INITDIALOG:
{
DragAcceptFiles(hwnd,TRUE);
........
...
}
no problemo, I catch the WM_DROPFILES
but I want it for my list view control (IDC_LIST1)
so I did that
case WM_INITDIALOG:
{
DragAcceptFiles(GetDlgItem(hwnd,IDC_LIST1),TRUE);
........
...
}
and impossible to catch the msg...
I try to catch everywhere, whitout result..
if someone can help me!!!
|
|
|
|
|
youpiyoyo wrote:
I try to catch everywhere
Did you try subclassing the list control?
"No matter where you go, there your are." - Buckaroo Banzai
-pete
|
|
|
|
|
How do I subclass the list control????
|
|
|
|
|
Type CListCtrl in the Search window and click the Go button
"No matter where you go, there your are." - Buckaroo Banzai
-pete
|
|
|
|
|
As I had said before in the title, it was coded in api win32, and not in MFC,
so for the CListCtrl it won't work.....
I try something with windowlong...
|
|
|
|
|
MFC does not change the way a control works. All the same styles, messages and structures apply equally.
"No matter where you go, there your are." - Buckaroo Banzai
-pete
|
|
|
|
|
ok thank you for your help, I finally found it, you tell me the truth, with subclassing...
for people who are interesting there is my solution:
<br />
WNDPROC wpOrigEditProc;<br />
<br />
LRESULT APIENTRY EditSubclassProc(<br />
HWND hwnd, <br />
UINT uMsg, <br />
WPARAM wParam, <br />
LPARAM lParam) <br />
{ <br />
if (uMsg == WM_GETDLGCODE) <br />
return DLGC_WANTALLKEYS; <br />
if(uMsg == WM_DROPFILES) MessageBox(0,"drop",0,0);<br />
<br />
return CallWindowProc(wpOrigEditProc, hwnd, uMsg, <br />
wParam, lParam); <br />
} <br />
<br />
LRESULT CALLBACK DlgMainProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)<br />
{<br />
switch(msg)<br />
{<br />
case WM_INITDIALOG:<br />
{<br />
DragAcceptFiles(GetDlgItem(hwnd,IDC_LIST1),TRUE);<br />
wpOrigEditProc = (WNDPROC)SetWindowLong(GetDlgItem(hwnd,IDC_LIST1),GWL_WNDPROC,(LONG) EditSubclassProc);<br />
<br />
........<br />
.......<br />
}<br />
...<br />
for people who have questions e-mail me!!!
|
|
|
|