|
Rajesh R Subramanian wrote: What are you expecting to achieve with system("pause")?
My application is running and it closes with out any notice. I want to display one message to the console before it closes. So I used system("PAUSE") command. It didn't work. What else to do?
|
|
|
|
|
As I already told you, if your application crashes you can't display anything in the console anymore. Why don't you learn to use your debugger properly ? It will save you a lot of time and headaches in the future and it is not very difficult to use.
To begin, simply press F5 to start your debugger. Normally, it will already point you to the crash location. You can still put breakpoints in your code (F9) to see the evolution.
Why not just experiment a bit with it ? It won't kill your PC and you will learn much more doing that than asking questions in a forum.
|
|
|
|
|
At first, the system("pause") caught my attention and therefore I replied. Now, you simply cannot output something "after" your program has crashed, because it is already dead. No matter what you do.
Please use the debugger, as Cedric already said.
|
|
|
|
|
Try executing this code from outside of the IDE, with a command prompt window already open.
"Love people and use things, not love things and use people." - Unknown
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
Hi all..
As i am new c# .net......I have created a structure in Dll and calling that DLL in vc++ console Application....
I am getting the structure variable in my console application...
when i put printf..I am able to see the values..
but when i save it in a text file i am getting buffer value ..
Actually i am trying with code..
<br />
const _TCHAR *elementName[100];<br />
const _TCHAR *elementValue[100];<br />
Sharepoint_API::StructGetSite HUGEP *pBSTR; <br />
hr = SafeArrayAccessData(pICalc->GetData, (void HUGEP* FAR*)&pBSTR); <br />
for(i=0; i<pBSTR[0].totAttribute; i++){<br />
elementName [i] = "NAME";<br />
elementValue[i] = (LPCTSTR)pBSTR[i].Atrribute; <br />
printf("%d. is %S \n", i+1, elementValue[i]);<br />
ofstream TestFile("E:\\Test.txt",ios::app);<br />
if(TestFile) <br />
{<br />
TestFile<<elementValue[i];
}<br />
else if(!TestFile) <br />
{<br />
}<br />
TestFile.close();
In printf I am getting the correct value...
but in text file i am getting "h"
pBSTR[0].totAttribute is the total count i am getting from structure from dll
thank you....very much..
manju
Hi..
I am Mnaju.I have Completed my B.E Computers Science.Lokking for a job.I am interested in VC++
manju
|
|
|
|
|
Probably you've to replace
TestFile << elementValue[i];
with
TestFile.write( (const char*) elementValue[i], _tcslen(elementValue[i])*sizeof(TCHAR));
since even a wostream would not do the trick.
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
Sorry sir...
not working..
yet the same result..
I am getting output as
hhhhh
Hi..
I am Mnaju.I have Completed my B.E Computers Science.Lokking for a job.I am interested in VC++
manju
|
|
|
|
|
What's the input, instead?
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
CPallini wrote: What's the input, instead?
Actually i will get the sharepoint folders which are stored in structures in the dll...
Actually i must get
/////////////////////////////
http://sharepoint/Docs
http://sharepoint/News
http://sharepoint/Reports
http://sharepoint/SearchCenter
http://sharepoint/SiteDirectory
/////////////////////////////
when i put printf
i.e printf("%d. is %S \n", i+1, elementValue[i]);
I am getting the value for elementValue[i]
Hi..
I am Mnaju.I have Completed my B.E Computers Science.Lokking for a job.I am interested in VC++
manju
|
|
|
|
|
If you need to write a UNICODE file the code I provided works fine but you have to put the proper BOM at the very start of the file, for instance
TCHAR * szIn = _T("http://sharepoint/Docs");
ofstream of("foo.txt", ios::out);
#ifdef _UNICODE
TCHAR BOM = 0xFEFF;
of.write((const char *) &BOM, sizeof(TCHAR));
#endif
of.write((const char *) szIn, _tcslen(szIn)* sizeof(TCHAR));
of.close();
On the other hand, if you need to write a ANSI file then follow Naveen suggestion: use wofstream instead of ofstream.
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
|
Rajesh R Subramanian wrote: [Suspicious]
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
Hint: That's just not an emoticon, it is a hyperlink, in my previous post.
A post of mine is downvoted for no good reason (IMHO) in that thread. So, superhero intervention needed.
|
|
|
|
|
Rajesh R Subramanian wrote: That's just not an emoticon, it is a hyperlink, in my previous post.
OMG: I'm Mr.Dumb (drugz, maybe?).
BTW: balanced.
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
CPallini wrote: BTW: balanced.
Thanks, Mr.Dumb.
|
|
|
|
|
manju#123 wrote: ofstream TestFile("E:\\Test.txt",ios::app);
Since your writing a wide char text, either you have to use wofstream instead of ofstream or
Covert the elementValue[i] to mutibyte using sprintf() or WideCharToMultiByte() before writing..
manju#123 wrote: I am Mnaju
Correct your signature
|
|
|
|
|
Naveen wrote: manju#123 wrote:
I am Mnaju
Correct your signature [Smile]
nave
[OpenedFileFinder]
Also 'lokking ' should be fixed in the signature.
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
ops. I didn't notice
|
|
|
|
|
If i need to draw 10 images by considering the height of the CDialogBar window and it should exactly fit to the window even after changing the size..
|
|
|
|
|
Dynamically drawing 10 images to an area depends on the no of pixels.. Do you checked the minimum pixel area required to fit 10 image in the dialog bar
|
|
|
|
|
Which part of that is giving you trouble?
Mark
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
Hi all,
I read this article by Dr. Luigi: http://www.codeproject.com/KB/webservices/CurrencyConvertor.aspx[^] I used my own wsdl file to produce the headers and cpp files I may need. After following the instructions and applying it to my project i got this error at build:
1>UpdateServiceModule.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: static void __cdecl xercesc_2_7::XMLPlatformUtils::Initialize(char const * const,char const * const,class xercesc_2_7::PanicHandler * const,class xercesc_2_7::MemoryManager * const,bool)" (__imp_?Initialize@XMLPlatformUtils@xercesc_2_7@@SAXQBD0QAVPanicHandler@2@QAVMemoryManager@2@_N@Z) referenced in function "public: long __thiscall redmap::CUpdateServiceModule::PreMessageLoop(int)" (?PreMessageLoop@CUpdateServiceModule@redmap@@QAEJH@Z)
1>UpdateServiceModule.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) public: static char const * const xercesc_2_7::XMLUni::fgXercescDefaultLocale" (__imp_?fgXercescDefaultLocale@XMLUni@xercesc_2_7@@2QBDB)
1>UpdateServiceModule.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: static void __cdecl xercesc_2_7::XMLPlatformUtils::Terminate(void)" (__imp_?Terminate@XMLPlatformUtils@xercesc_2_7@@SAXXZ) referenced in function "public: long __thiscall redmap::CUpdateServiceModule::PostMessageLoop(void)" (?PostMessageLoop@CUpdateServiceModule@redmap@@QAEJXZ)
1>xmldata.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: __thiscall xercesc_2_7::XercesDOMParser::XercesDOMParser(class xercesc_2_7::XMLValidator * const,class xercesc_2_7::MemoryManager * const,class xercesc_2_7::XMLGrammarPool * const)" (__imp_??0XercesDOMParser@xercesc_2_7@@QAE@QAVXMLValidator@1@QAVMemoryManager@1@QAVXMLGrammarPool@1@@Z) referenced in function "public: __thiscall redmap::xml::XmlFile::XmlFile(void)" (??0XmlFile@xml@redmap@@QAE@XZ)
1>xmldata.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) public: static class xercesc_2_7::MemoryManager * xercesc_2_7::XMLPlatformUtils::fgMemoryManager" (__imp_?fgMemoryManager@XMLPlatformUtils@xercesc_2_7@@2PAVMemoryManager@2@A)
1>xmldata.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: virtual __thiscall xercesc_2_7::XercesDOMParser::~XercesDOMParser(void)" (__imp_??1XercesDOMParser@xercesc_2_7@@UAE@XZ) referenced in function "public: __thiscall redmap::xml::XmlFile::~XmlFile(void)" (??1XmlFile@xml@redmap@@QAE@XZ)
1>xmldata.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: class xercesc_2_7::DOMDocument * __thiscall xercesc_2_7::AbstractDOMParser::getDocument(void)" (__imp_?getDocument@AbstractDOMParser@xercesc_2_7@@QAEPAVDOMDocument@2@XZ) referenced in function "public: bool __thiscall redmap::xml::XmlFile::Open(wchar_t const *,wchar_t const *)" (?Open@XmlFile@xml@redmap@@QAE_NPB_W0@Z)
1>xmldata.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: void __thiscall xercesc_2_7::AbstractDOMParser::parse(wchar_t const * const)" (__imp_?parse@AbstractDOMParser@xercesc_2_7@@QAEXQB_W@Z) referenced in function "public: bool __thiscall redmap::xml::XmlFile::Open(wchar_t const *,wchar_t const *)" (?Open@XmlFile@xml@redmap@@QAE_NPB_W0@Z)
1>xmldata.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: static class xercesc_2_7::DOMImplementation * __cdecl xercesc_2_7::DOMImplementationRegistry::getDOMImplementation(wchar_t const *)" (__imp_?getDOMImplementation@DOMImplementationRegistry@xercesc_2_7@@SAPAVDOMImplementation@2@PB_W@Z) referenced in function "public: bool __thiscall redmap::xml::XmlFile::Create(wchar_t const *)" (?Create@XmlFile@xml@redmap@@QAE_NPB_W@Z)
1>xmldata.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: virtual __thiscall xercesc_2_7::LocalFileFormatTarget::~LocalFileFormatTarget(void)" (__imp_??1LocalFileFormatTarget@xercesc_2_7@@UAE@XZ) referenced in function "public: bool __thiscall redmap::xml::XmlFile::Save(wchar_t const *)" (?Save@XmlFile@xml@redmap@@QAE_NPB_W@Z)
1>xmldata.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: __thiscall xercesc_2_7::LocalFileFormatTarget::LocalFileFormatTarget(wchar_t const * const,class xercesc_2_7::MemoryManager * const)" (__imp_??0LocalFileFormatTarget@xercesc_2_7@@QAE@QB_WQAVMemoryManager@1@@Z) referenced in function "public: bool __thiscall redmap::xml::XmlFile::Save(wchar_t const *)" (?Save@XmlFile@xml@redmap@@QAE_NPB_W@Z)
1>xmldata.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: void __thiscall xercesc_2_7::XercesDOMParser::resetDocumentPool(void)" (__imp_?resetDocumentPool@XercesDOMParser@xercesc_2_7@@QAEXXZ) referenced in function "public: void __thiscall redmap::xml::XmlFile::Close(void)" (?Close@XmlFile@xml@redmap@@QAEXXZ)
1>D:\SVN\Licensin System\Work Package\UpdateManager\Debug\UpdateService.exe : fatal error LNK1120: 12 unresolved externals
Can anyone please help me understand this?
thanks,
Jayjay
|
|
|
|
|
Did you link with the xerces library ? It seems that you need it.
|
|
|
|
|
Hi Cedric,
where should I link it?
|
|
|
|
|
It looks like Xerces [^] library is missing in your project.
BTW: Why don't you ask directly the author (using the article's own thread)?
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|