|
john5632 wrote: 1. Regular DLL using shared MFC DLL
2. Regular DLL with MFC statically linked
almost same, but 2 one would be bulky in comparison of 1, as MFC dll would be statically linked.
MFC extension dll can be used only with MFC application! rest can be used with n number of lanaguage
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow Never mind - my own stupidity is the source of every "problem" - Mixture
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
Support CRY- Child Relief and You
|
|
|
|
|
I am able to build MFC Ext DLL. I also intergarte .h,.lib and .dll files in my application and working fine. But my worry is..I have almost 15 file (.h and .cpp) which is need to be placed inside dll file.
Is there any solution that I am able to add only single .h file for all .cpp file.
If yes then how to do?
|
|
|
|
|
It all depends what you're trying to achieve. MFC extension DLLs do what they say on the tin, they extend MFC and you can't use it in application if the application's not MFC. So if you don't want to write an MFC app then this choice isn't for you!
Regular DLLs can be called by any application. They expose a C or C++ interface that doesn't use MFC in the interface. You can still use MFC internally though, in the implementation. If you want you code callable by non-MFC apps use a regular DLL (say you implement a control using MFC but give it a fairly bog standard message interface, or you're insane and for some reason like CString).
The final choice is whether to link MFC statically or dynamically. Linking statically increases the size of your DLL but means you won't have to ship an MFC DLL with your app (or use the merge module in your installer). This makes it a bit more self contained. However even using a simple window class can be quite costly in terms of what MFC stuff your DLL has to drag in to do it's stuff. If you link dynamically your DLL will be smaller but you'll have to ship another stonking great DLL. If you're already shipping the MFC DLL for another nefarious purpose it's a no brainer, link dynamically. Otherwise build both ways and see which gives you a size you're happy with.
Cheers,
Ash
|
|
|
|
|
Hi, every one,
when i do encrypt, i meet some problem, if somebody who meet this kind of problem,can you tell me how to solve this problem, thank you!
First: I write a encrypt funtion using C++, and after I get the asymmetric key pair, then I want to save the key to the key store, in C++, I did not find such of function. But under .NET, there is a class named CspParameters, it can save a key to a container, all the code I see is below:
int main()
{
// creates the CspParameters object and sets the key container name used to store the RSA key pair
CspParameters^ cp = gcnew CspParameters;
cp->KeyContainerName = "MyKeyContainerName";
// instantiates the rsa instance accessing the key container MyKeyContainerName
RSACryptoServiceProvider^ rsa = gcnew RSACryptoServiceProvider( cp );
// add the below line to delete the key entry in MyKeyContainerName
// rsa.PersistKeyInCsp = false;
//writes out the current key pair used in the rsa instance
Console::WriteLine( "Key is : \n{0}", rsa->ToXmlString( true ) );
}
My qusetion is :
If I donot use the CspParameters class, how can I save the key pair to the key store using C++,if donot have this kind of function , how can i save my key pair, but not saved to BLOB.
Thank you very much!
|
|
|
|
|
Hi,
I drived a class from CStaic. Now I am using this new class for static control.
I am facing problem to draw the color on backgroung, I tried OnCtlColor() but breakpoint is not coming in this function.
What might be the cause?
|
|
|
|
|
Am not sure i completely understand what you are trying to do but check out this[^], if i am correct than it should help (you will need ON_WM_CTLCOLOR_REFLECT for your case i belive). Good luck.
> The problem with computers is that they do what you tell them to do and not what you want them to do. <
> Computers are evil, EVIL i tell you!! <
|
|
|
|
|
john5632 wrote: I am facing problem to draw the color on backgroung, I tried OnCtlColor() but breakpoint is not coming in this function
are you redrawing in you main dialog? or in staticcontrol derived class
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow Never mind - my own stupidity is the source of every "problem" - Mixture
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
Support CRY- Child Relief and You
|
|
|
|
|
Hi,
I have a problem in resolving the issue of GetFont() used in dialog box class for getting font but its returning NULL in one of the dialog class but its working in all the other dialog box classes.. The error comes in using the getlogfont() function where it crashes.. What could be the problem as it works fine in other dialog classes ... ?? please reply soon ...
modified on Monday, May 31, 2010 2:14 AM
|
|
|
|
|
it very dificult to answer without look on your code, where it failing!
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow Never mind - my own stupidity is the source of every "problem" - Mixture
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
Support CRY- Child Relief and You
|
|
|
|
|
the code which i am using is
CWnd* p_Wnd;
CFont* pFont;
pFont = p_Wnd->GetFont();
LOGFONT m_lFontBold;
pFont->GetLogFont(&m_lFontBold);
I am getting error in getlogfont in debugging mode. As far my understanding the getfont() isn't returning the handle to the object that is why there is an assertion problem in getlogfont(). But the same code is working properly in different dialog boxes.
|
|
|
|
|
pleaz use a valid CWnd* p_Wnd...
p_Wnd = this;
Press F1 for help or google it.
Greetings from Germany
|
|
|
|
|
If you check the documentation[^] for WM_GETFONT (CDialog's GetFont is a wrapper around that), a NULL value means your dialog is using the system font. Otherwise, if you are not testing this in debug mode (so you don't get a debug assert) then you simply get a NULL back if you call GetFont on a dialog that has not been created, as far as i know at least. (Ok, if you run it in debug you still get the NULL back if your dialog wasn't created, but you would also get a DEBUG ASSERT FAILED notification...)
> The problem with computers is that they do what you tell them to do and not what you want them to do. <
> Computers are evil, EVIL i tell you!! <
|
|
|
|
|
the code which i am using is
CWnd* p_Wnd;
CFont* pFont;
pFont = p_Wnd->GetFont();
LOGFONT m_lFontBold;
pFont->GetLogFont(&m_lFontBold);
I am getting error in getlogfont in debugging mode. As far my understanding the getfont() isn't returning the handle to the object that is why there is an assertion problem in getlogfont(). But the same code is working properly in different dialog boxes.
|
|
|
|
|
In the code you have shown you never initialize p_Wnd to anything...but i will assume that in the actual code segment you do. So what is the difference between this dialog and the others? How do you create it? When/Where do you ask for its font?
> The problem with computers is that they do what you tell them to do and not what you want them to do. <
> Computers are evil, EVIL i tell you!! <
|
|
|
|
|
I am using this code in oninitdialog function to set up the bold font on initialization of dialog. There is no difference in other dialog boxes and this one for setting up the fonts. I havent initialized the pWnd in this code and in any other initdialog functions but still that works.
|
|
|
|
|
I have attached the control of dialog box to the cwnd object using getdlgitem()..
|
|
|
|
|
So you say you call GetFont thorough an uninitialized pointer and it works???? That doesn't sound normal...
> The problem with computers is that they do what you tell them to do and not what you want them to do. <
> Computers are evil, EVIL i tell you!! <
|
|
|
|
|
hey i have initialized the cwnd object by passing the control of the dialog box static text using getdlgitem() function
|
|
|
|
|
And you did the same thing in all your dialogs, retrieve the handle of a static on the dialog in OnInitDialog, attach a CWnd to it, call GetFont on it, and it gave you a valid CFont pointer except for this one, identically implemented dialog? Can't think of anything smart, sorry...maybe someone else has a better response then.
> The problem with computers is that they do what you tell them to do and not what you want them to do. <
> Computers are evil, EVIL i tell you!! <
|
|
|
|
|
hey after doing some research work .. This problem is changed to the static text only.. The problem seems to work on the button controls but when i use static text for the cwnd object initialization to get the font then it crashes in the getlogfont function... so give me some insight for this....
|
|
|
|
|
My guesses are as follows:
-since the documentation for WM_GETFONT says that a NULL return value means the control is using the system font, a NULL from the static control must mean it is using the system font.
-possible that the static control will use the font of its parent window to draw text unless it gets a different font explicitly set to it via WM_SETFONT, and that is why you get the NULL back, meaning that the static doesn't have its own font set, it will use its parent's.
> The problem with computers is that they do what you tell them to do and not what you want them to do. <
> Computers are evil, EVIL i tell you!! <
|
|
|
|
|
so why is it working for the button control and not for the static text control... and also this static text control thing do work in different dialog classes.. and I havent explicitly called the WM_getfont for those classes....
|
|
|
|
|
decoder_85 wrote: so why is it working for the button control and not for the static text control
-because of their different implementation i supose
decoder_85 wrote: and also this static text control thing do work in different dialog classes
-i can't tell you that without seeing the whole picture
decoder_85 wrote: and I havent explicitly called the WM_getfont for those classes
-CWnd::GetFont(), which is inherited by the CDialog, is just a wrapper around WM_GETFONT, if you call it, WM_GETFONT is sent to the control, and on the handle it returns CFont::FromHandle is called, you can check that yourself if you take a peek at CWnd::SetFont's implementation (try right-clicking it in visual studio and select "Go to definition" or somesuch)
> The problem with computers is that they do what you tell them to do and not what you want them to do. <
> Computers are evil, EVIL i tell you!! <
|
|
|
|
|
Hi All
How to Convert character to other character like german,dutch etc. which user can change a language during run-time, for example, selecting it from menu.Can any one help me
modified on Monday, May 31, 2010 1:18 AM
|
|
|
|
|
I think there is no easy method to do this. You have to store each language strings separately and use them based on the language selection from menu.
prvn
|
|
|
|