|
Hi
I am really new to vc++ and i am havin a great trouble with the GUI part..
I need to create a diagram structure dynamically.I use a logic like create CButton objects dynamically and plot them on a window,then connect them using a CPaintDC object.
I use a thread(a static function) which wil invoke the function that creates the diagram. But whenever i call the function it creates the button line everything but afterthat it gets hanged...
Can anyone get me out of this hell???
Plzzzzzzzzzzz..........
|
|
|
|
|
A couple of breakpoints in the debugger would be a good start.
Alcohol. The cause of, and the solution to, all of life's problems - Homer Simpson
|
|
|
|
|
I'm trying to find the drive letters allocated for USB devices.The flow i follow is,
I'm finding all logical drives connected to the system. from each dive letter i'm finding the device number. Then by enumerating thru all the devices belonging to GUID (GUID_DEVINTERFACE_DISK or VOLUME) i'm enumerating through all the devices that belongs to this class GUID.
The API's i'm using are
SetupDiGetClassDevs()
SetupDiEnumInterfaceDevice
SetupDiEnumInterfaceDetail() - (SP_DEVINFO_DATA structure returns the device instanceID ).
For Vista this flow is working fine. In XP this API's is returning the same instanceID for me for different devices(In some scenario).
Example : IF i connect a USB FDD and USB Memory key , for both the devices the
SP_DEVINFO_DATA structure returns me the same instanceID.
Please help me to find the problem.
Thanks in advance.
Best Regards,
Thushar
|
|
|
|
|
Hi,
i have a CButton with the property "Visible false", which is the method for set visible this button???
Thanks
Regards
Raiz ;P
|
|
|
|
|
Either add WS_VISIBLE style by using ModifyStyle ,
ModifyStyle(WS_VISIBLE,0);should be ModifyStyle(0,WS_VISIBLE);</
or use ShowWindow(SW_SHOW);
-- modified at 7:36 Monday 12th March, 2007
|
|
|
|
|
Ing.Raiz82 wrote: have a CButton with the property "Visible false", which is the method for set visible this button???
ShowWindow()!
|
|
|
|
|
You can set visible to True on the property window of button
|
|
|
|
|
Thanks...
i'm stupid...ehhehehe
bye...
|
|
|
|
|
good idea....ehhehehe
raiz
|
|
|
|
|
|
Hi
All
I want to change font of menu item of my application only in VC++6.0. When i change font of menu from control pannel then it change all menu fonts of OS. But i want to chnage the font of only myaplicatuion, how it can be done, please help me about this.
Regards
Atul Mahajan
|
|
|
|
|
M. Atul wrote:
Hi
All
I want to change font of menu item of my application only in VC++6.0. When i change font of menu from control pannel then it change all menu fonts of OS. But i want to chnage the font of only myaplicatuion, how it can be done, please help me about this.
Owner drawn menu!
http://www.codeproject.com/menu/[^]
|
|
|
|
|
Hi all,
I would like to know what is the maximum size of character buffer.
At the moment I have the following:
#define BUFFER_SIZE 4096
Can it be any bigger ?
Many Thanx
Regards,
The only programmers that are better than C programmers are those who code in 1's and 0's.....
Programm3r My Blog: ^_^
|
|
|
|
|
Programm3r wrote: I would like to know what is the maximum size of character buffer.
you mean, the maximum amount of characters the system can allocate to you ?
all depends of the system, and i'm not sure this can be retrieved like that...
|
|
|
|
|
toxcct wrote: you mean, the maximum amount of characters the system can allocate to you ?
Yes, for example;
char test[MAX_BUF_SIZE];
toxcct wrote: and i'm not sure this can be retrieved like that
How would you do it?
Thanx for the reply toxcct
Regards,
The only programmers that are better than C programmers are those who code in 1's and 0's.....
Programm3r My Blog: ^_^
|
|
|
|
|
i'm not sure at all this can be done, at least, not statically.
you should use new , and allocate a smaller amount of memory if it cannot allocate what you asked it to.
|
|
|
|
|
Thanx for your input toxcct, i'll give it a shot.
Regards,
The only programmers that are better than C programmers are those who code in 1's and 0's.....
Programm3r My Blog: ^_^
|
|
|
|
|
Actually he should use a ‘vector’ and avoid using ‘new’ if at all possible.
INTP
"Program testing can be used to show the presence of bugs, but never to show their absence."Edsger Dijkstra
|
|
|
|
|
Programm3r wrote: char test[MAX_BUF_SIZE]; // Max amount of character ??
you can have your buffer size like this
#define MY_MAX_BUF_SIZE 9192
|
|
|
|
|
|
Programm3r wrote: char test[MAX_BUF_SIZE]; // Max amount of character ??.
The maximum amount will be governed by the program's stack size, which defaults to 1MB.
"Approved Workmen Are Not Ashamed" - 2 Timothy 2:15
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
Programm3r wrote: Can it be any bigger ?
The short answer is yes!
Now for the long answer! (Which is still a short answer).
It depends on the amount of memory available at the time. When we where programming for 16-bit processors the limit was 65536 (unless you threw in a compiler specific modifier), but if you where not allocating the buffer from the heap, you would have to increase the size of the program stack to accommodate it.
When working with memory the size can vary depending on many things, my best recommendation is to use the STL ‘vector’ template. The vector template is just a dynamic buffer (or array); meaning that you do not need to know the number of items you are going to store ahead of time. If you do know the number of items (elements) then you can set it to that size, so that it will not have to look for another continuous memory block latter.
If for some reason you need a ridiculous buffer size (like 3GB or more) then you will have to turn to the Windows specific functions dealing with virtual memory. Virtual memory is limited to all available memory, including the amount of space left on your hard drive.
When ever possible use the STL containers and avoid using ‘new’ when you need to store more than one item. This will simplify your code and in the long run save you a lot of head aches.
I will end this by saying that many courses taught today center around managed memory (.Net), which compounds a problem I use to think was just in their heads. That is people failing to realize that if you take something (allocate memory) you have to return it or it will not be available latter when you need it. A ‘vector’ like most STL containers solves the same problem, if you use a ‘vector’ then you do not need to remember to ‘delete’ the memory you allocated using ‘new’, because it will be done automatically when the ‘vector’ goes out of scope.
INTP
"Program testing can be used to show the presence of bugs, but never to show their absence."Edsger Dijkstra
|
|
|
|
|
John, thank you very much, that helps alot.
The only programmers that are better than C programmers are those who code in 1's and 0's.....
Programm3r My Blog: ^_^
|
|
|
|
|
Programm3r wrote: The only programmers that are better than C programmers are those who code in 1's and 0's
Funny you should mention that because that is where I started! I mean that literally, as the only programming I was ever taught by any one was at the machine level (below assembly). A good C programmer can look at the code and see the assembly code lying just under the surface, but that is still one level above machine code. I will always like C, but I prefer C++ because it allows you to express your ideas in a much fuller way, with less work. If anyone ever tells you that they can do something in C++ that you can not do in C, tell them to go suck a rotten egg. If it can not be done in C then it can not be done period.
INTP
"Program testing can be used to show the presence of bugs, but never to show their absence."Edsger Dijkstra
|
|
|
|
|
John R. Shaw wrote: tell them to go suck a rotten egg
LMAO ...
The only programmers that are better than C programmers are those who code in 1's and 0's.....
Programm3r My Blog: ^_^
|
|
|
|