|
I did read about that in a google search. However (and I'm showing my ignorance here!) this is the first ever DLL I've created myself, and I generated it using the MFC dll wizard: I can't find that procedure *anywhere*! If someone could point me in the right direction it would be much appreciated.
Ta!
Debbie
|
|
|
|
|
There's a function called DllMain in your .dll project. It's called by Windows during initialization of your .dll and gets the right HINSTANCE. You can store HINSTANCe somewhere or call GetModuleFileName right in DllMain.
DllMain(HINSTANCE hInstance, DWORD dwReason, LPVOID lpReserved)
{
char buf[1024];
GetModuleFileName(hInstance, buf, sizeof(buf));
...
}
To find DllMain, expand 'Globals' item in ClassView.
Tomasz Sowinski -- http://www.shooltz.com
*** Purgamentum init, exit purgamentum ***
|
|
|
|
|
Hi,
Thanks for the advice. My orignal probelm appears to be sorted, (see other post), but I would like to understand a bit more about it.
My Globals don't contain a DllMain function (unless I need new glasses , I did look, honest!).
It has 4 functions DLLCanUnloadNow; DLLGetClassObject; DllRegisterServer and DllUnregisterServer. This is a COM interface, maybe that makes a difference?
I'm afraid I'm very new to both DLLs and COM. It appears to be working (amazingly), but it's a bit like black magic atm. Maybe all will become clear in time. I do hope so!
Ta!
Debbie
|
|
|
|
|
I still haven't found the DllMain method, but I have sussed out that I can access the _Module directly (having had a look at the DllGetClassObject method. This does seem to do the trick in giving me the right filename. I'm not exactly sure that I fully understand it, yet, though!
<br />
HINSTANCE hMine = _Module.m_hInst;<br />
GetModuleFileName (hMine, cFileName, _MAX_PATH);<br />
|
|
|
|
|
hi,
I have a sizeable ListCtrl in a FromView.
The ListCtrl has a report style.
Additionally I want to size the column of the
ListCtrl when sizing.
But the scrollbars don't want what I want.
When the row count grows up and the horizontal
scrollbar is shown the vertical scrollbar
is shown, but it is not nessaray.
Second it is liable to run around. When the first
column width was changed the headerctrl
sends a WM_SIZE to the listctrl.
How can I avoid this.
<br />
MyFormView::OnSize(...)<br />
{<br />
m_ListCtrl.::MoveWindow(...,..., TRUE);<br />
}<br />
<br />
MyListCtrl::OnSize(UINT nType, int cx, int cy) <br />
{<br />
int iCol;<br />
int nCols =GetHeaderCtrl()->GetItemCount();<br />
int nWidth=0;<br />
RECT rect;<br />
float f;<br />
SCROLLINFO scrinfo={0};<br />
CHeaderCtrl* pHdr=GetHeaderCtrl();<br />
HDITEM hdi={0};<br />
<br />
CListCtrl::OnSize(nType, cx, cy);<br />
<br />
for(iCol=0;iCol<nCols;iCol++)<br />
{<br />
pHdr->GetItemRect(iCol,&rect);<br />
nWidth+=rect.right-rect.left;<br />
}<br />
<br />
GetScrollInfo(SB_VERT,&scrinfo);<br />
if(scrinfo.nPage<=scrinfo.nMax)<br />
{<br />
GetClientRect(&rect);<br />
cx=rect.right-GetSystemMetrics(SM_CXVSCROLL);<br />
}<br />
<br />
f=(float)(cx)/(float)(nWidth);<br />
<br />
<br />
hdi.mask=HDI_WIDTH;<br />
for(iCol=0;iCol<nCols;iCol++)<br />
{<br />
pHdr->GetItem(iCol,&hdi);<br />
hdi.cxy=f*hdi.cxy;<br />
pHdr->SetItem(iCol,&hdi);<br />
<br />
}<br />
}<br />
<br />
|
|
|
|
|
My app works fine as far as I know. But I just noticed that when I am in debug mode with breakpoints and it loads up until the UI appears, the output window says "First Chance Exception" in two places. Yet the app does fine (as far as I know I hasten to add). Do I need to worry and if so, how do I fix this problem?
Appreciate your help,
ns
|
|
|
|
|
Hi, first chance exceptions are generally c++ exceptions
like possibly in MFC, you can safely ignore them.
|
|
|
|
|
Ah! I was starting to get really despondent about this, my latest discovery (I have other stuff to do), and thought I'd done some horrendous thing somewhere which will show up sometime. I am so relieved!
Thanks,
Appreciate your help,
ns
|
|
|
|
|
Don't worry about 'first chance exceptions.' For more info, see KB article Q105675.
Tomasz Sowinski -- http://www.shooltz.com
*** Purgamentum init, exit purgamentum ***
|
|
|
|
|
when i compile, i all of the sudden get all these messages:
d:\90GIG\MP3ORGANIZER\FileTransfer\main.cpp(547): error C2143: syntax error : missing ')' before ';'
d:\90GIG\MP3ORGANIZER\FileTransfer\main.cpp(547): error C2059: syntax error : ')'
d:\90GIG\MP3ORGANIZER\FileTransfer\main.cpp(567): error C2143: syntax error : missing ')' before ';'
d:\90GIG\MP3ORGANIZER\FileTransfer\main.cpp(567): error C2660: 'ReadFile' : function does not take 3 parameters
d:\90GIG\MP3ORGANIZER\FileTransfer\main.cpp(567): error C2143: syntax error : missing ';' before ','
d:\90GIG\MP3ORGANIZER\FileTransfer\main.cpp(567): error C2059: syntax error : ')'
d:\90GIG\MP3ORGANIZER\FileTransfer\main.cpp(582): error C2143: syntax error : missing ')' before ';'
d:\90GIG\MP3ORGANIZER\FileTransfer\main.cpp(582): error C2143: syntax error : missing ')' before ';'
d:\90GIG\MP3ORGANIZER\FileTransfer\main.cpp(582): error C2059: syntax error : ')'
d:\90GIG\MP3ORGANIZER\FileTransfer\main.cpp(582): error C2143: syntax error : missing ';' before '&&'
d:\90GIG\MP3ORGANIZER\FileTransfer\main.cpp(582): error C2059: syntax error : ')'
d:\90GIG\MP3ORGANIZER\FileTransfer\main.cpp(614): error C2143: syntax error : missing ')' before ';'
d:\90GIG\MP3ORGANIZER\FileTransfer\main.cpp(614): error C2059: syntax error : ')'
d:\90GIG\MP3ORGANIZER\FileTransfer\main.cpp(632): error C2143: syntax error : missing ')' before ';'
d:\90GIG\MP3ORGANIZER\FileTransfer\main.cpp(632): error C2660: 'recv' : function does not take 3 parameters
d:\90GIG\MP3ORGANIZER\FileTransfer\main.cpp(632): error C2143: syntax error : missing ';' before ','
d:\90GIG\MP3ORGANIZER\FileTransfer\main.cpp(632): error C2059: syntax error : ')'
The first error message directs me to this line:
szFileBuffer = (char *)malloc(SEND_BUFFER_SIZE);
what is wrong with that? there's no ) missing
and the "ReadFile function does not take 3 parameters" directs me here:
ReadFile(hFile, szFileBuffer, SEND_BUFFER_SIZE, &dwBytesRead, NULL);
there isn't threee parameters there, there are five! i don't understand it... and all of the other error messages are wrong too, i'm not missing an ')' or an ';' in any of the places, what could be wrong?
thanks
-Rune Svendsen
|
|
|
|
|
Post the #define SEND_BUFFER_SIZE line.
Tomasz Sowinski -- http://www.shooltz.com
*** Purgamentum init, exit purgamentum ***
|
|
|
|
|
It's
#define SEND_BUFFER_SIZE 8192;
it's the ; that made the errors, thanks to both of you.
|
|
|
|
|
I suppose the SEND_BUFFER_SIZE looks like this
#define SEND_BUFFER_SIZE 100;
This would introduce errors of this kind.
I keep submitting “VB” as a Priority-1 bug, but apparently no one here knows how to fix it. Nick Hodapp, Semicolon
|
|
|
|
|
Hi friends ,
i 'v a problem.. i want to get the handle of a editbox in applet chat program..how can i get the handle ..?
Program The Future.
|
|
|
|
|
Use Spy++ to get the ID of the edit control. With this, you should be able to grab handle of main window (the edit's parent) with FindWindow and get the edit handle with GetDlgItem.
Tomasz Sowinski -- http://www.shooltz.com
*** Purgamentum init, exit purgamentum ***
|
|
|
|
|
nopes..the spy shows the classname as InternetExplorer_server(Remember its is shown in an explorer..pls look my question...)
I like the dreams of the future than the history of the past.
|
|
|
|
|
So what? Can't you go deeper in windows hierarchy and get the ID of edit box?
Tomasz Sowinski -- http://www.shooltz.com
*** Purgamentum init, exit purgamentum ***
|
|
|
|
|
sorry i hav no idea..can u help..?
I like the dreams of the future than the history of the past.
|
|
|
|
|
Can you expand 'InternetExplorer_Server' item in the Spy++ windows tree?
Tomasz Sowinski -- http://www.shooltz.com
*** Purgamentum init, exit purgamentum ***
|
|
|
|
|
ok..i get..i can now see the handle and classnames...
i want to write some sort of automation(that is i want to write the messages in to the textbox and apply the send button just like the booting software for Yahoo! messenger..(pls dont misunderstand me....!!!!!)by using another program)...
what i want to do.. is there is any samle code available for the same problem ..??
I like the dreams of the future than the history of the past.
|
|
|
|
|
I'd take the following steps:
1) locate main IE window with FindWindow
2) step into windows hierarchy with GetDlgItem (if you know the control ID) or EnumChildWindows (if you only know class name).
Tomasz Sowinski -- http://www.shooltz.com
*** Purgamentum init, exit purgamentum ***
|
|
|
|
|
thankssssssssssssss..thanks a lotttttttttttt..!!!!
I like the dreams of the future than the history of the past.
|
|
|
|
|
I want to show a Startdialog at the beginn of my SDI/MDI application. Where do I have to put the code for the dialogbox, and how can i manage that the box close automaticly after (for excample) 2 seconds?
|
|
|
|
|
Are you sure you want a dialog box and not classic splash screen displaying bitmap image?
Tomasz Sowinski -- http://www.shooltz.com
*** Purgamentum init, exit purgamentum ***
|
|
|
|
|
What is a classic splash screen? How can I create it?
|
|
|
|