|
One way is convert std::string to CString using marshalling
|
|
|
|
|
|
Hi All,,
I want some information about size of class.
I have tested one example like below...
class A<br />
{<br />
};
I declared one class but there is no any params into this.But when I see its size using sizeof() fuction it shows 1 .So I want to know for what it stores one byte.
Thanks in Advance.
Ashish Bhatt
|
|
|
|
|
|
|
I konw that in windows, with "extended desktop" I can use two monitors to form a big virtual screen.
But, how can I make the two monitors display part of the same screen.
For example:
I have two monitors with the same 1024*768 display mode, if I use windows to set the virtual screen ,it gets 2048*768 display mode.
But now, I want to get the 2024*768 display mode.
The first one displays [top-left](0,0)-[bottom-rigth](1023,767) of virtual screen, and the second one displays [top-left](1000,0)-[bottom-right](2023, 767).
As a result, left of first one and left of the second one displays the same region((1000,0)-(1023,767))
thank you for any suggestion
modified on Sunday, December 09, 2007 8:08:52 PM
|
|
|
|
|
Hi all!
How to create a setup file for another program in Visual C++?
plzz help
|
|
|
|
|
If you have Visual Studio then it should have a wizard that allows you to create Setup applications (quickly as well).
Otherwise, just write one.
Mark.
|
|
|
|
|
If not...
you can check the NSIS or the Innosetup programs.
Greetings.
--------
M.D.V.
If something has a solution... Why do we have to worry about?. If it has no solution... For what reason do we have to worry about?
Help me to understand what I'm saying, and I'll explain it better to you
“The First Rule of Program Optimization: Don't do it. The Second Rule of Program Optimization (for experts only!): Don't do it yet.” - Michael A. Jackson
|
|
|
|
|
I need to write a C program that prints a letter made of letters. It's like a mosaic.
Ex:
A
AAA
AA AA
AA AA
AA AA
AAAAAAAAAAA
AA AA
AA AA
I can make a letter like this, with a matrix or just with printf. The hardest part is that it needs to print words made of these letters. It's hard cause with printf you always write \n at the end and you cant print 2 letters next to each other. Only one below another.
So I'm begging you If you can find a sample program or give me a tip or a full program at best
I'll be really gratefull
Thanks in advance
modified on Sunday, December 09, 2007 12:30:19 PM
|
|
|
|
|
there are functions that allow you positioning along the screen like a goto (x,y). So you can continue using your methode of the matrix, but insteads of "printf" use every position in your matrix as a square (let's say...) 10x10 pixels, so you go through the matrix moving the cursor in 10 pixels on every i++ and writing or not writting as you need.
Greetings.
--------
M.D.V.
If something has a solution... Why do we have to worry about?. If it has no solution... For what reason do we have to worry about?
Help me to understand what I'm saying, and I'll explain it better to you
“The First Rule of Program Optimization: Don't do it. The Second Rule of Program Optimization (for experts only!): Don't do it yet.” - Michael A. Jackson
|
|
|
|
|
I'm building a VC++6 MFC application and trying to run it I received the message in the Subject line:
stack overflow
What can I do to avoid such messages?
How to check the stack and to set it.
...in VC++6, please...
36. When you surround an army, leave an outlet free.
...
Do not press a desperate foe too hard.
SUN-TZU - Art of War
|
|
|
|
|
Are you using some kind of recursion ? If yes, check if the recursion ends at some point. If that's not the case, you will never end calling the function which need some storage on the stack, until the stack is full.
That's one of the possible cause of stack overflow.
|
|
|
|
|
No. It isn't that case. Actually, I modified from the previous stable version some tables, making them permanentlly, instead of initialising locally with new or malloc() .
Can be a possible cause, too many global variables?
36. When you surround an army, leave an outlet free.
...
Do not press a desperate foe too hard.
SUN-TZU - Art of War
|
|
|
|
|
It's possible that your program itself can allocate too much memory on the stack. I once wrote a performance test driver to perform a bunch of operations by iterating through a memory cache with a HUGE array of integers. I believe it compiled OK, but at runtime, it failed with that error. Check that you aren't allocating any huge arrays, and by that I mean in the area of 30000+.
|
|
|
|
|
If you've eliminated any recursion problems and simply need a
larger stack, you can set a larger stack size in your linker
options. Note the default stack size is 1MB.
See /STACK (Stack Allocations)[^]
Mark
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
Thanks!
The message appear immediately after PreCreateWindow
36. When you surround an army, leave an outlet free.
...
Do not press a desperate foe too hard.
SUN-TZU - Art of War
|
|
|
|
|
RomTibi wrote: I modified from the previous stable version some tables, making them permanentlly, instead of initialising locally with new or malloc()
Putting them on the stack didn't make them any more permanent than using dynamic
allocation.
In general, it may be better to use dynamic allocation (the new operator)
for large objects instead of using the stack. That way you don't have
to micro-manage your stack size. You want your stack to have some
breathing room. Use the heap - that's what it's for.
What's considered a "large" object? Opinions vary
Mark
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
Finally I resolved the problems by dinamically alocating the "guilty" tables.
A final question. I didn't find in my "old" VC++6 how to use the
/STACK
option for the linker. Do you know how?
Thanks for all
36. When you surround an army, leave an outlet free.
...
Do not press a desperate foe too hard.
SUN-TZU - Art of War
|
|
|
|
|
RomTibi wrote: A final question. I didn't find in my "old" VC++6 how to use the
/STACK
option for the linker. Do you know how?
I don't remember where it's at in VC6. Should be somewhere in the linker
settings for your project - look for a stack size option
Mark
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
OK Thanks!
36. When you surround an army, leave an outlet free.
...
Do not press a desperate foe too hard.
SUN-TZU - Art of War
|
|
|
|
|
During the creation of my Combo Box I entered the data into it for selection of the User. How do I find out what the User selected?
Please provide some code please.(VS 6.0 and VS 2008 C++)
A C++ programming language novice, but striving to learn
|
|
|
|
|
Do you want to get value or focus on combobox?
|
|
|
|
|
When the user changes the selected item, the parent will receive a CBN_SELCHANGE
notification (in a WM_COMMAND message). In response to that notification,
or at some other time you need the selected item from the combo box, you
could do something like this:
LRESULT SelectedIndex = SendMessage(hwndComboBox, CB_GETCURSEL, 0, 0);
if (CB_ERR != SelectedIndex)
{
LRESULT StringLength = SendMessage(hwndComboBox, CB_GETLBTEXTLEN, SelectedIndex, 0);
TCHAR *pSelectedString = new TCHAR[StringLength + 1];
SendMessage(hwndComboBox, CB_GETLBTEXT, SelectedIndex, (LPARAM)pSelectedString);
delete[] pSelectedString;
}
All Windows controls have associated messages used to manipulate them. Unless you
have them all memoized, I recommend keeping a link to this: Windows Controls[^]
or know where to find it in your local documentation.
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
Hey!
Well i dun ve visual studio 08. But i can provide you a help in visual studio 6.0.
Now as you have already entered data to the combo box.Add new variable for the Combo Box in class wizard. it can be of type VALUE or CONTROL. Let it be VALUE and type CString. This variable will hold the data present in the Combo Box.Let the variable is ComboBox_Variable.
Now to check what user has selected, you can put a simple event in your program which will help in finding what user has selected from the box.
so you can add a button which will show a simple messagebox depending on the combo box data. Like a button named "Message".
Add an event handler for it and you can use the following code.
<br />
CString example;<br />
example = ComboBox_Variable;<br />
if(example=="Data-1")<br />
MessageBox("Data-1 selected by user");<br />
else if(example=="Data-2")<br />
MessageBox("Data-2 selected by user");<br />
You can use switch statement too!
I hope Combo Box will be clear to you now!
|
|
|
|