|
I get similiar other warnings such as
warning C4996: 'strcat' was declared deprecated
warning C4996: 'fopen' was declared deprecated
warning C4996: 'itoa' was declared deprecated
why and when do these warnings arise ?
How to overcome them?
- thanks..
|
|
|
|
|
kapardhi wrote: why and when do these warnings arise ?
Because Microsoft introduced more secure versions of these functions. So either follow the advice given in the warning message (use the more secure version, like strcat_s) or disable the warning 4996 (you can specify that in the project options).
|
|
|
|
|
* You may suppress all the compiler warnings using /w option.
or
* Use /wd to supress a specific warning. Eg. /wd4996 will disable the compiler warning with ID 4996.
Regards,
Rane
|
|
|
|
|
I am using Visual c++ 6.0 MFC,
I have a problem to print pay slip on Dot Matrix printer. So I need to write my data on Text File and after Printing it.
Clearly, How can I Write to Text File et Print this File After with Visual c
++ 6.0 MFC.
Thanks
|
|
|
|
|
You can play with files in MFC using CFile class. Below shown code snippet will be of little help:
CFile cf_object;
cf_object.Open( "c:\\CP\\CP_test.txt", CFile::modeCreate|CFile::modeWrite);
char szText[100];
strcpy(szText, "File Write Test");
cf_object.Write (szText,100);
Regards,
Rane
|
|
|
|
|
|
These guys are fast. Let me add up something that has not been said yet:
You can open the port to which the printer is attached (usually LPT1) as a file (just pass LPT1 as the file name to the function which opens or creates the file). You can then just write text to this opened file, and you'll see the printer is printing it out. If you consult with the printer documentation, it must have some specific ASCII command patterns (known as EPSON ESC CODE sequences), which you could follow to get formatted output, such as a receipt.
Many are stubborn in pursuit of the path they have chosen, few in pursuit of the goal - Friedrich Nietzsche
.·´¯`·->Rajesh<-·´¯`·.
[Microsoft MVP - Visual C++]
|
|
|
|
|
Hi All
I want to convert MDI application code to dailog application code.Can any one help me which class i need to write in dailog application..
Or can i show MDI Out put on dailog application in list box?
Example link in here http://www.codeguru.com/cpp/w-p/clipboard/externallinks/article.php/c9155/[^]">
Plz help me..
modified on Monday, September 1, 2008 2:03 AM
|
|
|
|
|
What does the link have to do with your question ?
Anyway, there's no easy way to convert a MDI application to dialog based application. You need to restart a new project and copy/paste the classes and code you need. Of course, this is probably more complicated than that because the structure of the project changes completely.
|
|
|
|
|
Ok Can i show MDI out put on Dailog Application?
|
|
|
|
|
What do you mean ? If you want to put your MDI app contained on your dialog, that's not possible. Think a bit about it: you can have multiple documents open at the same time, how would do you put that on one single dialog ?
No, the best way to go is to completely rewrite your application and reuse part of the code. Otherwise this will be a complete mess.
|
|
|
|
|
ok can you give me some example how can i stat to rewrite application..
Plz help me
|
|
|
|
|
Not really no, because it completely depends on what you want to implement. The only advice I can give you is to create an empty dialog based application and then to add features little by little.
But converting from a MDI application to a dialog based application seems a very awkward choice, because the structure of your program and the way the user interacts with it are completely different. Are you sure you want to do such a thing ? What's the reason behind that choice ?
|
|
|
|
|
yes i want to change.Sir i have past here one link which is given information of current copy information and i want to do this in dailog based application,so i want to convert it.
Simply it is a programm of Clipboard viewer.And i search and ask question about it.But i havn't found solution.Now i am geting link from code guru and i want to change this application.
So plz help me
|
|
|
|
|
So, just because the guy use a dialog based application in his example, you are ready to throw out your existing MDI application and restart everything from scratch ? Sounds a very bad design decision, because as I said, MDI and dialog application are targeted for different usages.
|
|
|
|
|
SO in which way i go..Can you give me guid in which i go to do thatt?
Plz help me
|
|
|
|
|
Well, I don't even know what you are trying to do...
Anyway, the best advice I can give you is to read a good book about MFC, it seems that you are missing some fundamuntal concepts with MFC. A lot of people suggested this bool[^], never read it myself though.
|
|
|
|
|
Hi,
I have the following error.
Error 26 error LNK2019: unresolved external symbol "public: __thiscall CGetFootDlg::CGetFootDlg(class CWnd *)" (??0CGetFootDlg@@QAE@PAVCWnd@@@Z) referenced in function "public: __thiscall CMainDlg::CMainDlg(class CWnd *)" (??0CMainDlg@@QAE@PAVCWnd@@@Z) MainDlg.obj
Can any one tell me whats wrong!
Thanks
Dhiraj Kumar Saini
|
|
|
|
|
In the cpp file of the class CGetFootDlg, check the function CGetFootDlg::CGetFootDlg(class CWnd *) exists or not.
|
|
|
|
|
It exist but in the form
CGetFootDlg::CGetFootDlg(bool bMainDlg, CWnd* pParent /*=NULL*/)
: CDialog(CGetFootDlg::IDD, pParent)
{
m_bMainDlg = bMainDlg;
m_bChatTransferred = false;
}
Whats wrong with it;
Dhiraj Kumar Saini
|
|
|
|
|
Dhiraj kumar Saini wrote: Whats wrong with it;
So in the header file of CGetFootDlg, have you defined a function like
CGetFootDlg(bool bMainDlg, CWnd* pParent /*=NULL*/); ?
|
|
|
|
|
Yes i have declared it in the header file of CGetFoorDlg since this function is a contrucotr.
I have declared two contructors:
CGetFootDlg(CWnd* pParent = NULL);
and
CGetFootDlg(bool bMainDlg, CWnd* pParent = NULL);
|
|
|
|
|
Dhiraj kumar Saini wrote: CGetFootDlg(CWnd* pParent = NULL);
The above function dosent have the implimentation in cpp right. In the CPP you have only written implementation for CGetFootDlg(bool bMainDlg, CWnd* pParent = NULL);. So remove the first constructor from the header.
After this if you compile, you will get error from the constructor if CMainDlg. Because from that constructor, you are trying to call CGetFootDlg(CWnd* pParent);. But while linking, the compiler couldn't find the implementation. That why it gave out link error.
Modify the CMainDlg constructor to call the CGetFootDlg(bool bMainDlg, CWnd* pParent = NULL); constructor instead of CGetFootDlg(CWnd* pParent = NULL);
|
|
|
|
|
Hi ,
But in CMainDlg Constructor I am not calling CGetFootDlg.
Can u just explain it more
|
|
|
|
|
May be you have member variable of CGetFootDlg in CMainDlg.. isnt it?
|
|
|
|