|
I would like to be able to read a dialog template resource at compile time, for example I want to make sure before the program calls myDlg.Create(129/*IDD_DIALOG1*/, this) :
1) Is 129 a valid dialog template resource ID?
2) If yes, does the dialog associated with that template have WS_CHILD and WS_CAPTION style flags set?
Thank you.
|
|
|
|
|
|
FindResource() should do what you want. Also, check out EnumResourceNames() and EnumResourceTypes() .
"The pointy end goes in the other man." - Antonio Banderas (Zorro, 1998)
|
|
|
|
|
Heya,
I just did a search on the board and I got some different answers to this but I don't know which method to go for
What I have is a dialog template consisting of a tree control and now I want to add this tab control (property sheet) to it as well.
That is, I cannot just derive my dialog from the CPropertySheet class since I want other stuff on the dialog as well.
What's the best way to achieve this? Should I create a tab control and then somehow add property pages to each tab? If not, then how could I position the property sheet on before hand in the resource editor, etc.
Huge thanks in advance
|
|
|
|
|
I had a similar problem and i solved it this way.
Put a placeholder like static control on the dialog template that would be occupied by the propertysheet.
Then on the initdialog of the dialog, Create the propertysheet dynamically, add the pages, and use SetWindowPos to place the propertysheet at the static control placeholder.
I am not aware of anyother way.
God is Real, unless declared Integer.
|
|
|
|
|
Thanks for the fast answer
I thought of this myself.. I'd hoped for a more..uhm.. non-hack way, but seems I'll have to go for this one (if I don't get anymore replies)
Thanks again for your time
|
|
|
|
|
I know this works for sure, coz i have used it but only problem i have is the tab order, the propertysheet never gets control when tabing on the dialog, once the propertysheet is focused then tabing does not goes to other controls on the dialog.
God is Real, unless declared Integer.
|
|
|
|
|
You can embed the property sheet as a child control within the dialog. The Construct method in CPropertySheet should help.
Software Zen: delete this;
|
|
|
|
|
But then how do I position it correctly (the sheet)? Using a placeholder like Mr.Prakash suggested?
Looking forward to a little elaboration
|
|
|
|
|
Halloko wrote:
Using a placeholder
That's the easiest way.
Software Zen: delete this;
|
|
|
|
|
In my project i need run an executeable file inside a vc++ program. can any one please guide with some suggestion
|
|
|
|
|
shellexecute
createprocess
spawn
etc etc
what exactly else do u need from it?
"there is no spoon" biz stuff about me
|
|
|
|
|
Capturing console output may be ?
God is Real, unless declared Integer.
|
|
|
|
|
plz can i get source code in c or c++ to run an batch file.
|
|
|
|
|
shiva shankar wrote:
plz can i get source code in c or c++ to run an batch file.
in C, or c++ (in dos mode)
call
system("c:\\yourbatch.bat");
include process.h file
I want to change Myself..Can u help me?
|
|
|
|
|
whenever a folder is renamed with extension of system folders such as recycle bin,favorites etc., the data in it gets hidden.
how can i implement this using vc++
milind
|
|
|
|
|
refer IShellChangeNotify interface
I want to change Myself..Can u help me?
|
|
|
|
|
I'm programming an application on Sun platform.I should need to get constructor information for any struct.My program defined many struct types,i want to builde a generic arithmetic to process anyone of all struct variables.Therefore i must get members and its types of struct on run time.How can i do for it? Thank you for presenting me some helps.
|
|
|
|
|
Interesting. One possible solution is a map. Another solution is dynamic casting. Derive the structure from an interface.
Kuphryn
|
|
|
|
|
Hello, seems i have a problem on terminating processes by name. I need visual C, not c++ code to terminate processes. Does anybody have this? I wonder if it's even possible because i wrote some c++ code that terminates processes by name using szName but when i did a conversion to C gave me a lot of errors. If anybody has visual C code to terminate process, PLEASE HELP ME!
Oh by the way i am looking for this api: TerminateProcess(...)
-Ryan M.
|
|
|
|
|
TerminateProcess(...)
are you looking for this api ?
God is Real, unless declared Integer.
|
|
|
|
|
Hi!
But what Jeff Richter says, TerminateProcess() doesn't give a clean exit. Instead TerminateThread() or ExitProcess() can be used. TerminateProcess() is brutal.
|
|
|
|
|
may be, or may be not, the poster was looking for TerminateProcess and thats the answer for him. and he acknowledged it.
God is Real, unless declared Integer.
|
|
|
|
|
I have the following structs defined. I ultimately want to copy UserInfo into a BYTE buffer to send to an RS232 serial port..
typedef struct {
u_32 prot_ver;
u_32 nomem_ver;
u_32 func_units;
u_32 sysType;
u_32 startupMode;
AttributeList option_list;
AttributeList supported_aprofiles;
} UserInfo;
typedef struct {
u_16 attribute_id;
u_16 length;
u_16 attribute_val;
} AVAType;
typedef struct {
u_16 count;
u_16 length;
AVAType value[1];
} AttributeList;
I have a buffer
msgBuffer = new BYTE [1000];
and i'm tryin to do
memcpy (msgBuffer, (BYTE *) &UserInfo, sizeof (UserInfo);
The first 5 fields copy, but the AttributeList struct field dont copy immediately behind the u_32 in my msgBuffer.
I basically need the 'count' field of the AttributeList immediately behind the 'StartupMode' field.
Some its not copying right. HELP?!?!?!?!??!
-C
|
|
|
|
|
Compilers may not place all members of a struct adjacent to each other; this is called packing. Depending on the CPU architecture, it may be more efficient or even required that memory accesses take place on 2 byte, 4 byte, or higher boundaries. I believe the default packing for Visual C++ is 8 bytes. This means that your struct 's will have padding between the members.
Fortunately, you can override this behavior in your code:
#pragma pack(push,1)
typedef struct {
u_32 prot_ver;
u_32 nomem_ver;
u_32 func_units;
u_32 sysType;
u_32 startupMode;
AttributeList option_list;
AttributeList supported_aprofiles;
} UserInfo;
typedef struct {
u_16 attribute_id;
u_16 length;
u_16 attribute_val;
} AVAType;
typedef struct {
u_16 count;
u_16 length;
AVAType value[1];
} AttributeList;
#pragma pack(pop) The initial pragma saves the current packing level, and then sets it to 1, which will cause all members to be adjacent, with no padding. The final pragma restores the packing level.
Software Zen: delete this;
|
|
|
|