|
Hi,
can I test list-Box Styles (e.g. LBS_OWNERDRAWVARIABLE) and make sure it is set? Thats better then trusting in a user who sets properties in a dialog resource. Where do I handle this?
|
|
|
|
|
I tried CListBox::OnCreate, it is never called. I'm stuck.
|
|
|
|
|
Try PreCreateWindow
Joel Lucsy (jjlucsy@ameritech.net)
|
|
|
|
|
nope, is never called for a CLlistBox derived class
|
|
|
|
|
Hi All, Can anyone help with this? I'm now totally confused by conflicting articles....
I have a 16Bit DLL that I need to call from a VC++ 6.0 32Bit application. The DLL cannot be recompiled (and it will have a short life anyway).
The 32Bit application needs to run on Windows 9x / NT / 2000 /XP. My understanding is that I need to use the Generic Thunk for this - Is this correct? Is so how? I can find lots of examples of 16Bit calling 32Bit but not the other way around (and would'nt that be the more popular thing to do?) - Or is it so obvious that I am missing the point!
The functions in the 16Bit DLL have been declared as below:
int FAR PASCAL __export files_pack( char *, char *, unsigned, unsigned *, long );
int FAR PASCAL __export files_unpack( char *, char * );
int FAR PASCAL __export split_pack( char *, char *, unsigned *, long );
Does it make any difference because they use the PASCAL calling convention?
HELP PLEASE BEFORE I EXPLODE!
Regards
Kevin.
|
|
|
|
|
|
Thanks, but my confusion continues....
Accoriding to this....
http://support.microsoft.com/default.aspx?scid=kb;en-us;Q125710
A generic thunk supports all the platforms I require, and does not require the thunk compiler?
Am I any closer?
Regards,
Kevin.
|
|
|
|
|
A generic thunk is for 16 bits apps calling 32 apps and not the opposite .
Win95/98 supports flat thunks that permits a 32 app call a 16 bits app, this is what you want, I presume ?
Win NT/2000 doesn't not support Flat Thunks at all, so you must devise your form of IPC(Interprocess Communication Mecanism) . For instance doing your stub dll between the 16 bits dll and your code.
Cheers,
Joao Vaz
A person who is nice to you, but rude to the waiter, is not a nice person - Natalie Portman (Padme/Amidala of Star Wars)
|
|
|
|
|
See this article on MSJ
Nerditorium
It explains that the _stdcall aka PASCAL convention used causes some funky code to be used , since with _stdcall , the calle must clean the stack , not the caller when using _cdecl call convention.
HTH
Cheers,
Joao Vaz
A person who is nice to you, but rude to the waiter, is not a nice person - Natalie Portman (Padme/Amidala of Star Wars)
|
|
|
|
|
Thanks Joao, looks like I've been barking up the wrong tree all afternoon, time to start reading the correct artices!
Regards,
Kevin.
|
|
|
|
|
Hi People, so near yet so far.......
Can anyone help me further with this?
I compiled my .ASM modules for the 16Bit DLL, hunted around until I found my MASM disks, compiled the .OBJ, created a 32Bit DLL Stub but now I'm stuck on the linking. Below is the output from the compiler, I assume this has something to do with name mangeling? - Any suggestions?
--------------------Configuration: ThunkDLL2 - Win32 Debug--------------------
Linking...
thk32.obj : warning LNK4033: converting object format from OMF to COFF
ThunkDLL2.obj : error LNK2001: unresolved external symbol "int __stdcall pack_ThunkConnect32(char *,char *,void *,unsigned long)" (?pack_ThunkConnect32@@YGHPAD0PAXK@Z)
Debug/ThunkDLL2.dll : fatal error LNK1120: 1 unresolved externals
Error executing link.exe.
ThunkDLL2.dll - 2 error(s), 1 warning(s)
|
|
|
|
|
_stdcall mangles names , so normally prefixes a underscore to the functions adds a @ and puts in the name the total bytes of the arguments , and something more e.g :
pack_ThunkConnect32 function uses 4 arguments , so it uses 16 bytes(?) so the calle knows the amount of memory that must pop from stack to clean it .
A fast way to see the name is using quickview utility that comes with windows , and view the mangled name on the exports table ?
Cheers,
Joao Vaz
A person who is nice to you, but rude to the waiter, is not a nice person - Natalie Portman (Padme/Amidala of Star Wars)
|
|
|
|
|
If you used also c++ to do your dll you didn't forgot Extern "C" { ?
And here is the sample code to call stdcall ...
Assembly samples
Cheers,
Joao Vaz
A person who is nice to you, but rude to the waiter, is not a nice person - Natalie Portman (Padme/Amidala of Star Wars)
|
|
|
|
|
Hello,
I have a list view type MDI, I also have a MM Timer with in the CMainFrame. I am trying to assign a pointer to my list control from CMainFrame to get the number of items in the list control (inside the MM timer function). When I run the following code it crashes my app..
int count;
CListView* pList = (CListView*)(MDIGetActive()->GetActiveView());
count = pList->GetListCtrl().GetItemCount();
Is there a better way to get a pointer to CListView that wont crash my app?
|
|
|
|
|
Never mind.. I just moved the MM Timer to my CListView derived class and everything is working fine.. tnx anyways
|
|
|
|
|
hi,
how exactly is an ascii code converted into a character on the VDU?
If it is hardware embedded then how are japanese and chinese characters displayed even in dos?
-very curious
|
|
|
|
|
It is not hardware embedded. VDUs are raster-based, much the same as your TV: the OS basically draws the characters according to the font selected.
In the old days, so called ASCII terminals did the presentation internally --in those situations one could have problems displaying foreign characters.
Joaquín M López Muñoz
Telefónica, Investigación y Desarrollo
|
|
|
|
|
I have a CPropertySheet which has two property pages in Wizard mode. In my OnWizardFinish handler on the second page I do an EndDialog(IDOK). I then call another modal dialog, dialogB. The wizard dialog does not go away until dialogB is dismissed and the return from the OnWizardFinish is executed.
- Is there anyway to make the wizard dialog go away immediatly, the EndDialog does not seem to do it?
- I've unchecked the System Menu resource from the wizard dialog. The CPropertySheet puts the system close button (X) in the upper right corner. Is there a way to remove it?
Thanks in advance,
Bob
|
|
|
|
|
As for your first question, probably calling CMyPropertySheet::ShowWindow(SW_HIDE) before launching the second dialog will do.
Joaquín M López Muñoz
Telefónica, Investigación y Desarrollo
|
|
|
|
|
Thanks for your response. This has no effect, the dialog is still behind the latest one, as it was before.
|
|
|
|
|
You sure? Try this sequence:ShowWindow(SW_HIDE) , launch dialog, EndDialog .
Joaquín M López Muñoz
Telefónica, Investigación y Desarrollo
|
|
|
|
|
Are you calling ShowWindow( SW_HIDE ) directly from within the OnWizardFinish() handler, or are you calling GetParent() -> ShowWindow( SW_HIDE ) ?
As for the system menu, you can try specifying WS_POPUP without WS_SYSMENU when you create the Property Sheet, or modifying the Sheet's styles after creation.
Unchecking the System Menu in the Dialog/Resource Editor does little for you in this case, because the dialog editor is used to modify the Pages, not the Sheet.
Peace!
-=- James.
"Fat people are hard to kidnap."
(Try Check Favorites Sometime!)
|
|
|
|
|
James,
The GetParent()->ShowWindow(SW_HIDE) does the trick, thanks.
How would I modify the Sheet's style after creation to have WS_POPUP without WS_SYSMENU? I assume I would do it in it's OnInitDialog()?
Thanks,
Bob
|
|
|
|
|
I've got it, it's ModifyStyle (WS_SYSMENU, 0) in the Sheet's OnInitDialog.
Thanks for your help.
Bob
|
|
|
|
|
why not just have whatever called the CPropertySheet call the dialog whenever it returns?
if (MySheet.DoModal() == ID_WIZFINISH)
{
dialogB.doModal();
}
if you have a good reason then ignore my question
-dz
|
|
|
|