|
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;
|
|
|
|
|
I already had the the #pragma statements around my entire h-file and its still happening. Is there another setting for this??
Do I need to explicitly put it around each struct or at the beginnng of the H file sufficient?
I"m pushing and popping in every h-file that has structs defined. Thanks.
-C
|
|
|
|
|
Wheatbread wrote:
already had the the #pragma statements around my entire h-file and its still happening. Is there another setting for this??
There is a default value set using the /Zp command line option to the compiler. You can look in your project settings to see what it is.
Wheatbread wrote:
Do I need to explicitly put it around each struct or at the beginnng of the H file sufficient?
'Around each struct' is not required. The pragma pack(push,1) remains in effect until the corresponding pragma pack(pop) is encountered. Just for the sake of consistency, though, I would put the push and pop in each .H file that needed it. That way, if another .H is included in between that changes the packing level, you don't have unforseen changes taking place.
Software Zen: delete this;
|
|
|
|
|
My project settings are /Zp1. I changed structure alignment to 1 byte when I created the file.
Am I copying the struct wrong maybe? I've done this many times before and this hasnt happened.
Not sure how else to do it other than copying the AttributeList struct inside the larger struct separately, but that would SUCK!
I"ll take all suggestions here!!
-C
|
|
|
|
|
Actually I believe it is called alignment and I believe that the default behavior is to align data to the size of the item. This means a double (8 bytes) is aligned to an 8-byte boundary, four-byte items are aligned to four-byte boundaries, etc.
However, I don't have a good explanation for why the memcpy fails. I recommend inserting some trace messages to display the sizeof values to see if something looks weird. sizeof should take into account alignment issues.
__________________________________________
a two cent stamp short of going postal.
|
|
|
|
|
Print out the sizeof UserInfo. Make sure that value looks good.
Tim Smith
I'm going to patent thought. I have yet to see any prior art.
|
|
|
|