|
1st: Kudos on the "Dune" reference.
Jim Crafton wrote:
Is it possible to build programs that are built using the Multi-threaded DLL code generation options if you use STL?
Yes!
You have to understand that the STL does not care about multi-threading, it is irrelevant. The code that uses those template classes are the ones who have to care.
INTP
Every thing is relative...
|
|
|
|
|
OK, thanks!
However when I tried to build with it, I get link errors saying it can't find msvcrtd71.lib (or something like that).
I tried a simple test with the following:
#define WIN32_LEAN_AND_MEAN
#include <windows.h>
extern "C" {
__declspec(dllexport) void doit();
}
void doit()
{
int f = 90;
f += 345;
}
When I build this with /MDd (or /MD) I note that despite the fact that NO CRT code is used (as far as I can tell), it automatically links and uses the MS CRT DLL anyways!!!
My understanding is that you cannot use STL in DLL's that are NOT built with "Multi-threaded DLL" code generation options. So if you have DLL A and it uses STL (and has functions that use std::string) and have DLL B, that also uses DLL A, and both use std::string, then you must generate them using the "Multi-threaded DLL" code gen option.
What I remember is that if you just use the "Multi-threaded" option (i.e. static linkage to the CRT) then the strings will become corrupted.
¡El diablo está en mis pantalones! ¡Mire, mire!
Real Mentats use only 100% pure, unfooled around with Sapho Juice(tm)!
SELECT * FROM User WHERE Clue > 0
0 rows returned
Save an Orange - Use the VCF!
|
|
|
|
|
Good day,
I have a parent dialog instatialing a modeless dialog. My modeless dialog has a public function that updates the progress bar. Everytime I call tmpmodeless->UpdateProgressBar(step) where step is a number to increase, the progress bar show increase on display. I have also a public function in modeless dialog that updates the text for displaying the status tmpmodeless->UpdateMessageStatus(CString mymsg) but I doesnt update the display..
Here is my code:
// Variables of modeless dialog
CProgressCtrl m_ctrlProgress; // Created using MFC Class wizard so it sure points to the
// control id of progress bar.
CStatic m_statusdone; // Created using MFC Class wizard so it sure points to the
// control id CStatic control id. Also sure that Visible property is checked.
CMyParentDialog::MyInitialize()
{
CMyModelessDialog* tmpmodeless=new CMyModelessDialog(this);
tmpmodeless->Create(CMyModelessDialog::IDD);
tmpmodeless->ShowWindow(SW_SHOW);
tmpmodeless->UpdateProgressBar(10); //OK is reflects on screen
tmpmodeless->UpdateMessageStatus("Help me step 10"); doesnt change display..
tmpmodeless->UpdateProgressBar(20); //OK is reflects on screen
tmpmodeless->UpdateMessageStatus("Help me step 20"); still doesnt change display..
}
void CMyModelessDialog::UpdateProgressBar(int pStep)
{
m_ctrlProgress.SetPos(pStep);
}
void CMyModelessDialog::UpdateMessageStatus(CString mymsg) //Doesnt work.. why???????????????
{
m_statusdone.SetWindowText(mymsg);
UpdateData(TRUE);
}
Still Doesnt appear even if I manually put m_statusdone.SetWindowText("Test") under UpdateProgressBar because UpdateProgressBar sure does works on setting progressbar.
Is there something Wrong with CStatic control????
Thanks.
|
|
|
|
|
fjlv2005 wrote:
void CMyModelessDialog::UpdateMessageStatus(CString mymsg) //Doesnt work.. why???????????????
{
m_statusdone.SetWindowText(mymsg);
UpdateData(TRUE);
}
Why are you calling UpdateData(TRUE) at that point? Was it just for testing purposes?
Make sure your static control uses an identifier different than IDC_STATIC (i.e, -1)
--
jlr
http://jlamas.blogspot.com/[^]
|
|
|
|
|
Good day,
Yes Im sure im using ID which is not IDC_STATIC. UpdateData is just for testing...
Why does it doesnt update the display for my modesless dialog??
|
|
|
|
|
How in CEdit to install the cursor in anchor point?
C++ MFC
SetSel installs the cursor in an active end and scrolls the text, I should place(install) the cursor in anchor point, for auto replacement.
|
|
|
|
|
Could you go a little bit more ... in detail ?
SkyWalker
|
|
|
|
|
SetSel(...);
Just make the starting position and ending position the same (anchor point).
The carat (anchor) position is the starting position.
Note: You can reverse the positions passed to SetSel(...) by reversing the starting and ending points..
Under Windows the cursor position is the mouse arrow position and not the position of the text cursor (that's called a caret).
INTP
Every thing is relative...
|
|
|
|
|
Hello,
I have a CButton created dynamically with bitmap:
CButton
m_mybutton.Create(NULL,WS_CHILD|WS_VISIBLE|BS_OWNERDRAW,CRect(1,87,110,107),this, ID_BTNHEADBOOKMARK);
m_mybutton.LoadBitmaps(IDB_LISTHBOOKMARK, IDB_LISTHBOOKMARK, IDB_LISTHBOOKMARK, IDB_LISTHBOOKMARK);
The image have some area with Color RGB(255,0,255).
I wanted those area with that color above to be transparent.
How can I do it?
Hope i could get a response ASAP (if possible )
Also im using EVC, you can try it Visual Studio and if works, i'll try it to EVC3.0.
Thanks you very much.
|
|
|
|
|
My suggestion:
Derive a subclass from CButton, modify its style as owner-draw.
Overwrite the DrawItem() and use TransparentBlt() to paint the bitmap by yourself.
Lane
|
|
|
|
|
Lane,
I understand how to override DrawItem by creating a class derived from CButton, however there no TransparentBlt API in EVC3.0. Anyway to do TransparentBlt?
Thanks Lane
|
|
|
|
|
NewVCbie wrote:
Anyway to do TransparentBlt?
You can use the "True Mask" method. It is the method used by windows to draw icons. It involves creating a black and white mask bitmap that uses white as the transparent part and black as the opaque part. You can have a look at my article at http://www.codeproject.com/bitmap/pjaimage.asp[^] where I use the method to draw transparent bitmaps. Look at the CPJAImage::DrawTransparent() method.
Google[^]
"You're obviously a superstar." - Christian Graus about me - 12 Feb '03
"Obviously ??? You're definitely a superstar!!!" - mYkel - 21 Jun '04
"There's not enough blatant self-congratulatory backslapping in the world today..." - HumblePie - 21 Jun '05
Within you lies the power for good - Use it!
|
|
|
|
|
|
Hi!
I am working on MFC SDI application.
can anybody tell me any good example of using extern keyword. can extern be used for passing value of any string variable from one class to another. If it can be used, then how?
thanx
|
|
|
|
|
swaapu says:can extern be used for passing value of any string variable from one class to another?
No it is not possiable using extern.
extern is for different purpose.
if you want to declare later and but if you want to use before itself then use key word extern.
Nice talking to you.
|
|
|
|
|
Hello,
The extern keyword is used to say to the compiler that you are using a variable declared in another translation unit. See the following for example:
You have one translation unit where you define your variable
int g_nSomeInt = 0;
And another one where you want to use the variable
extern int g_nSomeInt;
void DoFoo()
{
g_nSomeInt++;
}
This is how extern can be used. It is adviced though too use accessor functions instead of the extern keyword.
Behind every great black man...
... is the police. - Conspiracy brother
Blog[^]
|
|
|
|
|
The extern keyword simply states that the variable or function is declared in a seperate translational unit. That is it is declared and defined in a seperate file from the one that depends on it.
Declaring a function prototype as external, only serves to inform the coder that it is declared and defined in another file.
Defining a variable as external, informs the complire that it is declared and defined golobaly in another file. The difference between a function protype and a global variable, is that a global variable must be declared external and a prototype is external by default.
I've workd with C code that required alot on global variables (dealing with hardware specific addresses). In that case a file was set off to the side to define all the hardware specific data (global variables), which needed to be declared as extern.
INTP
Every thing is relative...
|
|
|
|
|
Hi
Urgent plz. Help me in how to use ADO to store and retrieve image data from Oracle using VC++.
Thanks in Advance
|
|
|
|
|
|
Hi
How to use CByteArray to store images into PostgreSQL database from VC++.
Help me.
Thanks
|
|
|
|
|
Hello,
does anybody here know a good C++/C Implementation of the GNFS(General Number Field Sieve) or the SNFS (Special Number Field Sieve) Algorithm ?
With best regards,
Benedikt
|
|
|
|
|
Hi!!
I am working on an SDI MFC application. I have two dialog boxes. I want to pass some File name from one dialog box to another on clicking OK command button. The file name has to be displayed on the text box of second dialog, when the second dialog appears on the screen .
Can any body tell me , how to declare variables and wat functions to use. I am new to MFC.
Thanx
|
|
|
|
|
there are two methods
(1)use CWnd::SendMessage( UINT message,
WPARAM wParam = 0,
LPARAM lParam = 0
);
(2)you can add a variable in the CMainFrm. pass the File name of the first Dialog to the variable.then the second
Dialog access it.
libo
|
|
|
|
|
Hi!
Thanx for giving responses to my problem.
You had told me:
"add a variable in the CMainFrm. pass the File name of the first Dialog to the variable.then the second
Dialog access it."
But, please tell me , that ,"how to pass the file name of the first dialog to the variable..."
Can u tell me some code as I am new to mfc programming
Thanx a lot for ur valuable time
|
|
|
|
|
You have probably two classes derived from CDialog for your dialogs. Let them be (it's just an example) CYourDlg1 and CYourDlg2.
I guess you are using them like that (supossing they are modal):
CYourDlg1 dlg1;
.
.
dlg1.DoModal()
and
CYourDlg2 dlg2;
.
.
dlg2.DoModal()
respectively.
Now, let's say you want to pass some CString data (containing a fully qualified name of some file), which you get from dlg1, to dlg2.
You must add some data member to each of those two classes: CString m_strFile .
In the OnOK() function of CYourDlg1 you add the line:
m_strFile = ... with the dots replaced by something you are using there ( ).
Before calling dlg2.DoModal() , you initialize the data of dlg2 with data from dlg1:
dlg2.m_strFile = dlg1.m_strFile
SkyWalker
-- modified at 3:13 Sunday 9th October, 2005
|
|
|
|