|
If 2 same global variable exist in seperate dll or lib.
must a conflict happen?
|
|
|
|
|
For libs you may have a conflict.
Not for a DLL.
Steve
|
|
|
|
|
Hello,
Why do you have the same variable in 2 locations? Do they share the same purpose? If not, do they share the same namespace? If the answer to the last question is 'yes', you have a problem. This problem will only surface if you use the headers of both the DLL and the static library. You'll get name collissions. To solve this problem, you need to put the variables in different namespaces or give them other names.
Hope this helps.
Behind every great black man...
... is the police. - Conspiracy brother
Blog[^]
|
|
|
|
|
Good day!
I have a little Problem with the MFC...
I have a static box for Pictures. I use a global variable. This variable changes...
now my problem: i want that different pictures change in my static box -> the global variable must control the picture box.
Example: I have 3 Pictures: IDB_PIC1, IDB_PIC2, IDB_PIC3...
now the variable has (is an integer) contains 1-> the static box must now show the first picture (IDB_PIC1), than the variable changes to 2 -> now the static box must show me the picture2 (IDB_PIC2)
how can i realize this?
-- modified at 18:26 Wednesday 1st March, 2006
|
|
|
|
|
charass wrote: Example: I have 3 Pictures: IDB_PIC1, IDB_PIC2, IDB_PIC3...
Make them strings! In the resource editor when naming them surround them with quotes. For eg: "IDB_PIC1"
Now you can get the name of the picture you want based on the global variable like this...
CString picToBeUsed;
picToBeUsed.Format("IDB_PIC%d", g_globalVariable);
Now load the bitmap and place it on the static control.
CBitmap bmp;
bmp.LoadBitmap(picToBeUsed);
m_static.SetBitmap(bmp);
Nibu thomas
Software Developer
|
|
|
|
|
I did it! But there is an error...
Name of Pic.: IDB_PIC1
Name of Global variable: Promille
Name of the static Picture Box: IDC_PIC_Moe
void CAlkoholmaschineDlg::OnB_Likoer(){
CString IDB_PIC1;
IDB_PIC1.Format(IDB_PIC1, Promille);
CBitmap bmp;
bmp.LoadBitmap(IDB_PIC1);
IDC_PIC_Moe.SetBitmap(bmp);
}
The error message:
error C2228: left of '.SetBitmap' must have class/struct/union type
|
|
|
|
|
charass wrote: CString IDB_PIC1;
IDB_PIC1.Format(IDB_PIC1, Promille);
CBitmap bmp;
bmp.LoadBitmap(IDB_PIC1);
IDC_PIC_Moe.SetBitmap(bmp);
CString picVar;
picVar.Format("IDB_PIC_Moe%d",Promille);
CBitmap bmp;
bmp.LoadBitmap(picVar);
CStatic *pPicStatic = (CStatic*)GetDlgItem(IDC_PIC_Moe);
pPicStatic->SetBitmap(bmp); Nibu thomas
Software Developer
|
|
|
|
|
thx first
now there ist an other error
Alkoholmaschine\AlkoholmaschineDlg.cpp(790) : error C2039: 'LoadBitmapA' : is not a member of 'CStatic'
d:\programme\microsoft visual studio\vc98\mfc\include\afxwin.h(2676) : see declaration of 'CStatic'
edit: what ist this "LoadBitmapA" ? must i declare it before in CString?
-- modified at 4:40 Friday 3rd March, 2006
|
|
|
|
|
It's not LoadBitmap it's SetBitmap .
Nibu thomas
Software Developer
|
|
|
|
|
ok this works:
CBitmap bmp;
bmp.LoadBitmap(IDB_PIC_Moe1);
CStatic *pPicStatic = (CStatic*)GetDlgItem(IDC_PIC_Moe);
pPicStatic->SetBitmap(bmp);
THX VERY MUCH!
-- modified at 4:53 Friday 3rd March, 2006
|
|
|
|
|
But this won't solve your problem. This won't change the picture based on a global variable.
Nibu thomas
Software Developer
|
|
|
|
|
Hello fellows. I've been wondering, how can I perform a soft-reset (cold-reset) from a CAB installation file?
Regards,
FG.
A polar bear is a bear whose coordinates has been changed in terms of sine and cosine.
|
|
|
|
|
You're wanting to restart the computer? Look at ExitWindowsEx()
Ryan "Punctuality is only a virtue for those who aren't smart enough to think of good excuses for being late" John Nichol "Point Of Impact"
|
|
|
|
|
Thanks. I'm trying to restart my pocket pc indeed, but not from a common program, but from a cab installation file.
Regards,
Fernando.
A polar bear is a bear whose coordinates has been changed in terms of sine and cosine.
|
|
|
|
|
how can i disable the history recording feature of a web browser control?
- Kyle
|
|
|
|
|
Hi,
I need to implement an ActiveX control in a simple Dlg based MFC application.
This controls scans the serial port after messages and sends them to my application
( in theory that is)
In a VB application there is no problem to receive the event. But i need it in VC (MFC)
the init of the object seems to work and the messages should be sent (trace line in the
on_fire call) but i don't receive anything in my dlg.
I think that i missed some small init to work with events but i simply can't rememeber
what or wich. Any pointers would be very appriciated.
codito ergo sum
|
|
|
|
|
The following is for MSVC6. If you right click on the ActiveX control on the dialog and select "Events..." a dialog appears which will let you add event handlers.
Steve
|
|
|
|
|
Hi
I did that and a new member functions is created but i never seems to fall into
that function.
Very strange ???
codito ergo sum
|
|
|
|
|
I tested it with the calendar control and it works fine. I would guess the control isn't actually firing the event.
Steve
|
|
|
|
|
Ok
i've done some deep debugging into that altough the Fire_Message is called
there are no connections (connected appz) for this control ????
how is this possible ??? I have attached my project(activeX control) to the
test application (MFC dlg) and I am falling into a breakpoint in the
Fire_Message function, but there is no connection ???
Something wierd is going on.
codito ergo sum
|
|
|
|
|
Does anyone know what the following statement refers to:
//lint !e740
Thanks
r
|
|
|
|
|
It's a single-line comment.
"Let us be thankful for the fools. But for them the rest of us could not succeed." - Mark Twain
"There is no death, only a change of worlds." - Native American Proverb
|
|
|
|
|
Yes, I know this.
Any idea on the "lint !e740" part? Is this a comment I should understand?
|
|
|
|
|
russeller wrote: Any idea on the "lint !e740" part? Is this a comment I should understand?
It all depends on the context (e.g., how did it get there (Lint is assumed)? what code is it near?), I guess.
"Let us be thankful for the fools. But for them the rest of us could not succeed." - Mark Twain
"There is no death, only a change of worlds." - Native American Proverb
|
|
|
|
|
They want to ignore the Error 470 that the lint might have output for the following code.
You can maybe find out wht PC-Lint Error 470 is, and then that would give you some idea of what potentially squirelly code you are looking at.
People that start writing code immediately are programmers (or hackers), people that ask questions first are Software Engineers - Graham Shanks
|
|
|
|