|
Screw roses!!!!
Tim Smith
I know what you're thinking punk, you're thinking did he spell check this document? Well, to tell you the truth I kinda forgot myself in all this excitement. But being this here's CodeProject, the most powerful forums in the world and would blow your head clean off, you've got to ask yourself one question, Do I feel lucky? Well do ya punk?
|
|
|
|
|
|
Maybe someone could just make sure that I am clear on IJW. Microsoft says that it simply allows a user to make pure unmannaged API calls from within ? Managed C++ ? whereas a VB or C# developer must use the DLLImport PInvoke method? Is this pretty much all this means concerning IJW/It Just Works. I must add, what a naming scheme done by Microsoft, I think they are running out of acronyms.
Nick Parker
|
|
|
|
|
You get to do your own marshalling. And it's more natural than P/Invoke. And P/Invoke is ugly.
Nish
The posting stats are now in PDF:-
http://www.busterboy.org/codeproject/
Feel free to make your comments.
Updated - May 04th, Saturday
|
|
|
|
|
|
PInvoke is the ability to call unmanaged functions exported from DLL.
IJW is similar to PInvoke works on the same mechanism except that it can be used only to call functions within the same module (DLL/EXE). Thus it is also called local PInvoke.
They both work in the same way.
|
|
|
|
|
I have a SDI application in which I replace the default VIEW by 2 splitters and 3 other views. So that I have a treeview on the left of the first splitter splitting vertically while its right hand side is again split, horizontally, to have a ListView on top and a ScrollView at the bottom.
I have a Tabctrl in the CScrollView to which I add pages, where each page is a dialog with an edit box that is populated with a report selected from the list in the listview. I need to Preview this report and print it if necessary.
How do I achieve the Preview and Printing of my reports which are a part of a dialog in the CSrollView?
Since this application is a SDI and simultaneously the contents to be previewed and print are in a dialog in my CScrollView the samples under 'Printing' section on this site hasn't helped me much.
Any ideas/suggestion are welcomed.
Thanks in advance.
-Mahesh Shimpi
Ideas grow by sharing!!
|
|
|
|
|
As your dialogs are needed for printing, create a class that inherits from CDialog and add the virtual functions
OnPrepArePrinting()
OnBeginPrinting()
OnEndPrinting()
OnPrint()
to it. These can then be overriden in the dialogs actual classes. Now your view will need to farm the calls it gets to these functions out to all the dialogs that it is displaying through the tab control. As long as each dialog knows how many pages it needs to print, everyhing should work OK.
Roger Allen
Sonork 100.10016
If I had a quote, it would be a very good one.
|
|
|
|
|
I am quite new to Visual C++ so this may be a very newbie question.
Is it possible to embed a CMenu in a CDialog? The reason I am asking this question is that I am not really interested in using the doc/view architecture since it doesn't really seem like a good architecture to solve my problem.
|
|
|
|
|
Create a menu resource and then go to the Dialog
template in the resource editor and see the properties
of the dialog,
There you will find Menu ; select the menu resource you want to
attach. The go back to the Menu and bring up the class wizard,
you will prompted to select a class thru which you want to route
the commands( obviously the dialog) select the dlg class.
Voila u r ready!
|
|
|
|
|
I've made a button object within core Win32, but I want to change the FONT of the button.
1. How can I change the button's font (I know how to send the message, but then...)
2. Is a HGDIOBJ compatible with HFONT, and if not, how to convert (Can it be done with type casting?)
Thanks, Sjoerd
N.B. I'm not using MFC or WTL/ATL in this.
LPCSTR Dutch = "Double Dutch "
|
|
|
|
|
Create a CFont object in your application and use the WM_SETFONT message
SendMessage(hButton, WM_SETFONT, (WPARAM)Font.m_hObject, MAKELPARAM(TRUE, 0));
Make sure your font object lives for as long as the font is in use by the button.
Roger Allen
Sonork 100.10016
If I had a quote, it would be a very good one.
|
|
|
|
|
Instead of using CFont, It's also possible to use HFONT, together with GetObject(...) or GetStockObject(...)?
Sjoerd
LPCSTR Dutch = "Double Dutch "
|
|
|
|
|
Yes, in fact that's what they want. Just out of curiosity, did you get a copy of MSDN with Visual C++ (I assume that's what you are using.)? If so, those functions are well documented and will tell you all you need to know about them. MSDN is a huge lifesaver.
If not there is always MSDN online.
http://msdn.microsoft.com/
Jeremy L. Falcon
"You do not know the power of the dumb side."
<nobr>
Homepage : Sonork = 100.16311 Maybe my mangling might misguide malicious miscreants momentarily?
|
|
|
|
|
As Ravi suggested in your other post, use WM_SETFONT.
Jeremy L. Falcon
"You do not know the power of the dumb side."
<nobr>
Homepage : Sonork = 100.16311 Maybe my mangling might misguide malicious miscreants momentarily?
|
|
|
|
|
I can't seem to make any mod that are visable at run time.
ex. I move a button, compile, and it is still at the same position.
Any ideas?
|
|
|
|
|
I presume your actually building the app and not just compiling it and running the exe from the dir?
"Isn't that the "write once, debug everwhere" language?" Tom Archer on Java...
|
|
|
|
|
Yes I have been re-building everything.
I just switched configurations and it seems to work now.
Thanks for tripping my memory.
|
|
|
|
|
jimNLX wrote:
Yes I have been re-building everything.
I just switched configurations and it seems to work now.
If it happens again just clean it and it gets rid of temporary files so it will completely rebuild it all.
- Matt Newman / Windows XP Activist
-Sonork ID: 100.11179
01001001 00100000 01010000 01100001 01100100 00100000 01001101 01111001 00100000 01010000 01101111 01110011 01110100 00100000 01000011 01101111 01110101 01101110 01110100
|
|
|
|
|
Matt Newman wrote:
If it happens again just clean it and it gets rid of temporary files so it will completely rebuild it all.
There's also a rebuild all button (VC4 [I think],VC5,VC6), but it's not on your toolbar by default. I'm lazy and it caters to that.
Jeremy L. Falcon
"You do not know the power of the dumb side."
<nobr>
Homepage : Sonork = 100.16311 Maybe my mangling might misguide malicious miscreants momentarily?
|
|
|
|
|
I suggested Clean so you would be sure it is deleting all of the temp files.
- Matt Newman / Windows XP Activist
-Sonork ID: 100.11179
01001001 00100000 01010000 01100001 01100100 00100000 01001101 01111001 00100000 01010000 01101111 01110011 01110100 00100000 01000011 01101111 01110101 01101110 01110100
|
|
|
|
|
hello,
how to use GetItem(...).
see,in msdn,
tv_item leads to tv_dispinfo(or something)
this leads to a message where NMHDR is passed as one of the params but again one of the structures itself has a NMHDR type variable.
I am confused.Its circular.
help me please.
|
|
|
|
|
rebecca romji wrote:
this leads to a message where NMHDR is passed as one of the params but again one of the structures itself has a NMHDR type variable.
The newer common controls use WM_NOTIFY as opposed to WM_COMMAND for notifications. Notifications that use WM_NOTIFY require NMHDR structures to pass the notification information (think Notification Message HeaDeR). Notification messages that need to pass more information than the NMHDR structure can support pass structures that basically derive from (or begin with) NMHDR . That way, a common NMDHR is always available to the function that handles the message.
For example, the TVN_BEGINDRAG notification message is sent using WM_NOTIFY . That being the case, a NMHDR structure is required to be passed. But since the NMHDR structure does not support the required information of the notification message, a NMTREEVIEW structure is sent instead, which contains an embedded NMHDR structure as demonstrated here:
struct NMTREEVIEW<br />
{<br />
NMHDR hdr;
UINT action; <br />
TVITEM itemOld; <br />
TVITEM itemNew; <br />
POINT ptDrag; <br />
}
I hope that answered your question, instead of confusing you further!
Peace!
-=- James.
"Fat people are hard to kidnap."
(Try Check Favorites Sometime!)
|
|
|
|
|
Hi everyone,
I'm trying to distribute MDAC 2.5 with my application using Installer 2.0.
When the setup application is executed I want MDAC to be installed at the same time so my database app can run properly. I believe Installer 1.1 used to have a merge module that dealt with MDAC, but I can't find this in Installer 2.0.
Does anyone can any instructions or a reference for the best way to
distribute MDAC using Installer 2.0?
Thanks for your time,
Paul.
|
|
|
|
|
hey,
yah,that's true.I spent 750 rupees,300 above regular books to buy this but it just doesn't have advanced topice like messages and structures and all the kind of stuff Dunn and Chris do.I have james.l.conger api bible ,but its for win 3.1 but still way better than petzold.
I cannot find a newer version of conger.
Which is a really good book for advanced programmers ?
help me.
|
|
|
|