|
Ok. We can try to make an educated guess
My opinion is that the header is used both for declaring things and for defining them. The second use is activated by ELABORATE_ALL_VARIABLES . Let's say the header is called a.h : then I guess you have to #include it like always everywhere except in the one file a.cpp , where you should have to write:
#define ELABORATE_ALL_VARIABLES
#include "a.h"
... or, alternatively, define this macro for a.cpp in the properties section of the file (Fileview pane->right click on a.cpp ->Settings->Preprocessor definitions).
Good luck. Let me know if I can give you more assistance.
Joaquín M López Muñoz
Telefónica, Investigación y Desarrollo
|
|
|
|
|
I was wondering if it was at all possible, when 'maximizing' a dialog box, to make it so that it doesn't cover up the main menubar? When my dialog box maximizes itself, I want it to maximize to the size of the parent frame (if that's what the part below the menubar is called). Is this possible, if so, how?
|
|
|
|
|
You can resize your dialog to its parent's client area, which you can get by calling GetClientRect() . You'll probably need to convert the rect to screen coordinates before resizing your dialog. Something like this (untested!):
CMyDialog::doMaximize()
{
CRect rect;
GetParent()->GetClientRect (&rect);
ClientToScreen (&rect);
MoveWindow (&rect);
}
/ravi
Let's put "civil" back in "civilization"
Home | Articles | Freeware | Music
ravib@ravib.com
|
|
|
|
|
|
How to change language using VC++: for example, my windows XP is french and to read and use programs oriented for another language I have to perform a long operation of changing default language on my system. Where can I find information about this?
|
|
|
|
|
User LoadKeyBoardLayout API
By Setting the appropriate langauge Id to this APi One can switch between different langauge
Atif
|
|
|
|
|
Hi there,
How can I detect all the computers conected to my local network.
tnx
Yaniv
|
|
|
|
|
Start with WNetOpenEnum() .
Five birds are sitting on a fence.
Three of them decide to fly off.
How many are left?
|
|
|
|
|
Hi all,
I posted this a couple days ago but didn't get any response. Thought i would try to post it again and see if someone could help.
Wanted to know if it is possible to both pad a hex numbers with leading 0's and also format the width of the message.
I have a string and i just concat a hex number to it. I just want to space out the numbers so that they will line up with the next string added, so that it has the look of a table.
Right now i am padding the hex number like this:
int myString = 10005;
int myString2 = 20003;
testStr.Format("%03X" , myString);
Str += testStr;
testStr.Format("%03X" , myString2);
Str += testStr;
Listbox.AddString(Str);
I know if i take away the 0, then it will set the width, but i need to do both. CAN THIS BE DONE?
thanks in advance.
Jimmy
Just cause I am 15, doesn't mean I'm dumb! (I'll really be 4 on Feb. 29...the year 2004)
|
|
|
|
|
NewHSKid wrote:
Wanted to know if it is possible to both pad a hex numbers with leading 0's and also format the width of the message.
Sure: You know the width of your column, the length of your hex number, and the difference of both is the number of leading '0' you have to prepend.
Who is 'General Failure'? And why is he reading my harddisk?!?
|
|
|
|
|
You could do it in two stages, format the hex value, then take that as further input to another Format call, using %8.8s (pad on right) or %-8.8s (pad on left) as the format string second time around
eg
testStr1.Format("%03X",myString);
testStr2.Format("%03X",myString2);
Str.Format("%10.10s%10.10s",testStr1,testStr2);
Steve S
I was 15 once. It was a long time ago.
Today, it's 22 years since I started working full-time in IT.
|
|
|
|
|
and, (haven't used Format or printf for a while...) you can specify the field width as an argument itself, like this;
testStr.Format("%0*X", n, myString)
where n is the number of digits you want.
Steve S
|
|
|
|
|
How can I use vector.h in an MFC app?
class_a.cpp:
<br />
#include "stdafx.h"<br />
#include "class_b.h"<br />
class_b.h:
<br />
#include "vector"<br />
class_b.cpp:
<br />
#include "stdafx.h><br />
#include "class_b.h"<br />
There's no code yet.
Compiling class_b.cpp is no problem.
But compiling class_a results in a whole bunch of compiler errors (inside new.h, memory.h, ...). I think it has something to do with namespaces, but I'm not sure. I'm not declaring nor using namespaces of my own. Could also be an debug/release prob.
These are (part of) the errors:
<br />
vc98\include\new(35) : error C2061: syntax error : identifier 'THIS_FILE'<br />
vc98\include\new(35) : error C2091: function returns function<br />
vc98\include\new(35) : error C2809: 'operator new' has no formal parameters<br />
vc98\include\new(36) : error C2061: syntax error : identifier 'THIS_FILE'<br />
vc98\include\new(37) : error C2091: function returns function<br />
vc98\include\new(37) : error C2556: 'void *(__cdecl *__cdecl operator new(void))(unsigned int,const struct std::nothrow_t &)' : overloaded function differs only by return type from 'void *(__cdecl *__cdecl operator new(void))(unsigned int)'<br />
vc98\include\new(35) : see declaration of 'new'<br />
...
What do I have to do?
using: [VISUAL STUDIO 6.0 sp5] [WIN98/2]
|
|
|
|
|
hi,
Add code below in in stdafx.h
include <vector>
using namespace std;
This will do.
Cheers
Anand
The chosen One
|
|
|
|
|
You might want to make sure the #include >vector< appears before the block that reads
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
in all your files. One way to do this would be to put the #include inside stdafx.h instead.
Steve S
|
|
|
|
|
I've already tried to put the include everywhere, above, under, in another file, ... It didn't work.
I've tried it once again, and guess what...
tnx m8.
using: [VISUAL STUDIO 6.0 sp5] [WIN98/2]
|
|
|
|
|
Zizilamoroso wrote:
#include "stdafx.h>
Is the mixing of '"' and '>' a typo?
There is nothing more in your files than what you wrote? Then you probably need to add
class_a.cpp:<br />
#include "class_a.h"
Does it help?
Who is 'General Failure'? And why is he reading my harddisk?!?
|
|
|
|
|
Hi All
How can I design the form in vc++ that should appear like a form which pops up when we click at office assistance help in MS Word.
Thanks
|
|
|
|
|
Just a dialog box but to have some background invisible.
There are some articles in codeproject which explain this.
Sonork 100.41263:Anthony_Yio
|
|
|
|
|
These assistant are called MSAgent
And there is complete SDK Available for programming these agents,
one can download this SDK from microsoft Site.
There are many third party characters available as well.
Microsoft also provide MsAgent editor , using which one can create its own characters.
Atif Mushtaq
No Worries
|
|
|
|
|
|
Thanks for helping me
If u donot mind go to the MSWord Help and select office assistant,u will find office assistance image character
appear and then click and u will see form appear on the screen(If do searching). I want like that form and button flushing.
Thanks
|
|
|
|
|
there is a CCheckListBox, there is a CDragListBox, but how to use functions
of both classes?
thanks
|
|
|
|
|
I would like to make my program to fit into paper
when printing out. I know we should deal with that
with this function but I am not sure about parameter
Does anyone know what to put?
BITMAPINFOHEADER *pBMI = (BITMAPINFOHEADER*)(LPVOID)lock;
int nColors = 0;
if( pBMI->biBitCount <= 8 )
nColors = ( 1<< pBMI->biBitCount );
if( b_PrintFit )
{
::StretchDIBits( pDC->GetSafeHdc( ),
pInfo->m_rectDraw.left,
pInfo->m_rectDraw.top,
pBMI->biWidth,
pBMI->biHeight,
0,
0,
pBMI->biWidth,
pBMI->biHeight,
(LPBYTE)pBMI + (pBMI->biSize + nColors * sizeof(RGBQUAD)),
(BITMAPINFO*)pBMI,
DIB_RGB_COLORS,
SRCCOPY);
Thanks
shin
|
|
|
|
|
10th parameter of StretchDIBits should be a pointer to a buffer containing RGB data of bitmap you want to print.
For eg.
CBitmap bmp;
bmp.LoadBitmap(IDB_SOMEBITMAP);
BITMAP bm;
bmp.GetBitmap(&bm);
bm.bmBits is the pointer you need.
Other parameters may be right or wrong cause I dont know what they mean in your program.
By the way, for printing a bitmap you should to create a printer DC and to calculate destination rectangle with paper resolution.
For more info see MSDN!
|
|
|
|