|
You want to update the resource. Right?
You can use BeginUpdateResource(), UpdateResource(), and EndUpdateResource() , but not on a running exe.
this is this.
|
|
|
|
|
Use UpdateResource(..., RT_STRING, ...) .
"Ideas are a dime a dozen. People who put them into action are priceless." - Unknown
|
|
|
|
|
How can we use InputBox in VC6...is it similar to Vb? if not how to create one...
thanks
|
|
|
|
|
"edit box"?
... she said you are the perfect stranger she said baby let's keep it like this... Tunnel of Love, Dire Straits.
|
|
|
|
|
Add a dialog box to the resources. Attach a class to it. Make an edit box on the dialog. Attach a CString type variable to it. Then call it using DoModal(), check the return value. If it is IDOK, then get the CString variable from the dialog box variable.
CInputBox dlg;
if (dlg.DoModal() == IDOK)
{
CString s;
s = dlg.m_strText;
}
If you want to show a prompt also, then make a public CString m_strTitle; in the dialog class. In its OnInitDialog(), Use SetWindowText(m_strTitle) to set the title. Before calling DoModal(), set that CString variable to anything you want.
this is this.
|
|
|
|
|
there's no InputBox as VB do.
you'll have to create your own dialog resource, and write its behavior...
TOXCCT >>> GEII power [toxcct][VisualCalc]
|
|
|
|
|
See here.
"Ideas are a dime a dozen. People who put them into action are priceless." - Unknown
|
|
|
|
|
There is some class, say Class Test{};
And let there will be a pointer Test *ptest;
How to allocate 2D array of this class pointers m_array[x][y]?
that we will be able after allocation to do
m_array[0][0] = new Test();
m_array[1][0] = new Test();
... and so on.
9ine
|
|
|
|
|
#define X_SIZE 10
#define Y_SIZE 10
class Test {
};
Test* m_Array[X_SIZE][Y_SIZE];
for (int y = 0; y < Y_SIZE-1; y++) {
for (int x = 0 ; x > X_SIZE-1; x++) {
m_Array[x][y] = new Test();
}
}
easy, isn't it ?
TOXCCT >>> GEII power [toxcct][VisualCalc]
|
|
|
|
|
Here's some thoughts.
1) std::vector<std::vector<Test*> > my_2D_array;
2) std::map<std::pair<int,int>,Test*> my_map;
In both these cases you would still need to use new. But you can avoid that by letting the standard container do the allocation its self, by using one of these instead:
1) std::vector<std::vector<Test> > my_2D_array;
2) std::map<std::pair<int,int>,Test> my_map;
Vector is faster, but you should reserve space for the number of rows required and then reserve space for each individual row (columns). A bit of a pain, but a simple helper function can do that for you. Or you could just encapsulate the vector of vectors in your own class and use that to access it.
Map is slower, but easier to use. You can't, nor do you need to, reserve space ahead of time. To add a new item just do this:
my_map[std::make_pair(0,0)] = Test();
Note: If the key pair already exist in the map then it is replaced by the new element. If the key pair does not exist, it is add to the map.
When using standard containers you do not have to store pointers to classes, just make the class type the type that is being stored. That way you are not responsible for the clean up and the container is responsible for most of the type safety garantees.
Oh well, I hope that gave you some help.
INTP
Use standard containers when available, unless you have a very good reason to roll your own.
|
|
|
|
|
Hi,
I was write a GINA dll that works fine on Windows XP. I use version 3 of Winlogon functions that is compatible with Windows 2000+. But when I tested this dll on Windows 2000 Advanced Server and Windows Server 2003, a problem occurred. When the message dialog with message "Preparing network connections" or "Applying computer settings" appear, this dialog remains for a long time (in fact for ever). What could be happened? Do you know?
Thanks,
Esmaeil
|
|
|
|
|
Hi
How can i at runtime replace a picture that i have inserted initially in the dialog box with another one?
/\|-||\/|/\|)
|
|
|
|
|
|
Was this of no help?
"Ideas are a dime a dozen. People who put them into action are priceless." - Unknown
|
|
|
|
|
|
Respected all
Regards!
I am a begginer in VC++ and facing problem
" I have a few bitmaps and i have to select from List Box at runtime that which bitmap has to display, how i display a bitmap while selecting from List Box at RunTime.
Hope + response.
Form
david
|
|
|
|
|
For starters, you'll need a listbox with the LBS_OWNERDRAWFIXED style.
"Ideas are a dime a dozen. People who put them into action are priceless." - Unknown
|
|
|
|
|
I have downloaded a project that contains several cpp, sln, vcproj, and corresponding *.h files.
Could not open the vcproj or sln file.
I am using VC++6. How do I know which is the main cpp file? What file should I open via the IDE?
thanX
|
|
|
|
|
Anonymous wrote:
I have downloaded a project that contains several cpp, sln, vcproj, and corresponding *.h files.
Could not open the vcproj or sln file.
I am using VC++6.
Try using this tool :
VC++7 to VC++6 project converter[^] to convert and then try to open with vc6.
suhredayan There is no spoon.
|
|
|
|
|
I want to draw a string in an SDI using TextOut. But i have co-ordinates in millimeters. How can i convert them into pixels. Help needed urgently...
|
|
|
|
|
Ups!! The pixel is the basic unit of programmable color on a display or image so it's more a logical unit than a physical one, altough the physical size of a pixel depends on how you've set the resolution for the display screen:
If the display is at its maximum resolution, the physical size of a pixel will be the physical size of the dot of the display (usually .28mm but you should look to the specs of your display). If you've set the resolution to less, a pixel will be larger than the physical size of the screen's dot (the pixel will use more than one dot).
Hope it helps ...
Marc Soleda.
... she said you are the perfect stranger she said baby let's keep it like this... Tunnel of Love, Dire Straits.
|
|
|
|
|
Hi,
If you call 'GetDeviceCaps' on your device context you can get
the width and height, in millimeters, of your physical screen.
You can also get the resolution of the screen in pixels this way,
so you should be able to do some calculations based on these values...
Don't think you are, know you are...
|
|
|
|
|
Hi all,
I wanted to cature the screen and I found it but:
The functions I used didn't capture the Mouse Icon!
What Can I do for this problem?
Please Help me,
Cheers,
Thanks,
MILAD.
Every new thing you learn,Gives you a new personality.
|
|
|
|
|
You could draw the mouse icon yourself by using GetCursorPos, DrawIcon and GetCursor functions. This will only work by attaching your app's thread to the thread that has the window under the cursor. You can do this by using the following functions: GetCursorPos, WindowFromPoint, GetWindowThreadProcessId, GetCurrentThreadId and AttachThreadInput. It's a little messy but it works.
|
|
|
|
|
Hi dSolariuM,
This is the way to capture the entire screen
HDC hScreenDC = CreateDC("DISPLAY", NULL, NULL, NULL);
HDC hCompatibleDC = CreateCompatibleDC(hScreenDC);
HBITMAP hScreenBitmap = CreateCompatibleBitmap(hScreenDC,
GetDeviceCaps(hScreenDC, HORZRES), GetDeviceCaps(hScreenDC, VERTRES));
HGDIOBJ hPrevObject = SelectObject(hCompatibleDC, hScreenBitmap);
BitBlt(hCompatibleDC,0,0,GetDeviceCaps(hScreenDC, HORZRES),
GetDeviceCaps(hScreenDC, VERTRES),hScreenDC,0,0,SRCCOPY);
OpenClipboard(GetActiveWindow());
EmptyClipboard();
SetClipboardData(CF_BITMAP,hScreenBitmap);
CloseClipboard();
This code snipet would copy the screen snap in the clipboard.
Hope this would solve your problem.
Have fun !
Cheers,
Vishal
|
|
|
|