|
Debug Assertion Failed!!
Program: c:\myproject\myprogram.exe
File: olecli3.cpp
Line: 502
For information on how your program can cause an assertion failure, see the Visual C++ documentation on asserts
What would be the reason of getting this error message and why I didnn't get it before. The program get no changes, I simply go to debug folder and double clicked on the exe file to run my program... the program was working fine prior to the time I got this error message. After that, I can't event run my program at all.
what would be causeing this error??
Thanks you
|
|
|
|
|
File: olecli3.cpp
Line: 502
Make sure you don't look at the above file at the above line, as it could give you a strong hint at what is going wrong.
Seriously, go to that file at that line, and there is agood chance you figure out what is wrong. If not, post the content here (with some context) and we may be able to help you.
Michel
It is a lovely language, but it takes a very long time to say anything in it, because we do not say anything in it, unless it is worth taking a very long time to say, and to listen to.
- TreeBeard
|
|
|
|
|
that olecli3.cpp file is not in my project. it is a mfc cpp file.
and the run time error is in InitStance() method in projectApp file. the following code is created when you create the new project with ole support and that's where i got the run time error occure. What suprised me is I got no error or anything and the program run perfectly. but next time.. I run it again. there it is, the run time error occured there
<br />
if (RunEmbedded() || RunAutomated())
{<br />
COleTemplateServer::RegisterAll();<br />
}<br />
else<br />
{<br />
COleObjectFactory::UpdateRegistryAll();<br />
}<br />
|
|
|
|
|
Does anyone know how to use Visual InterDev/J++ Utility Projects (*.VUP) for a VC++ project? I know it's possible, but I don't know how to do it. I'm using Visual Studio 6.0 Professional Edition.
David
|
|
|
|
|
hi everyone,
i have a question about doc/view architecture.. i use odbc on my sdi, based on listview, application.. i have created a odbc object, m_db, in the myappDoc class. whenever i want to access to the database from the myappView class, i use these codes "mydb * dbobj = &GetDocument()->m_db".. my question is if i created a dialog in my sdi application, how do i access to the "m_db" odbc database object? thx in advance..
|
|
|
|
|
My usual way is to pass a pointer to the CDocument derived class as parameter of the dialog's constructor. This pointer is then assigned to a member variable.
Michael
Fat bottomed girls
You make the rockin' world go round -- Queen
|
|
|
|
|
I suppose there are two ways:
1. Add a member "m_db" to your dialog's class and set it when you construct the object, right before calling DoModal.
2. Use the global CWinApp to get the document object and then m_db from there. I don't recommed it, but the code would look something like this:
CDocTemplate* pDocTemplate = AfxGetApp()->GetNextDocTemplate(AfxGetApp()->GetFirstDocTemplatePosition());
CYourDocument* pDoc = (CYourDocument*)pDocTemplate->GetNextDoc(pDocTemplate->GetFirstDocPosition());
Regards,
Alvaro
Well done is better than well said. -- Benjamin Franklin
(I actually prefer medium-well.)
|
|
|
|
|
Hello,
I'm having the following problem. I've been developping with the Messenger Typelibrary in both VB and Delphi for quite a while now. As I wanted to switch to C++, I downloaded the headers and lib file that Microsoft gave free for download on their site. All seems to be more or less ok, I see all the classes, but NO EVENTS! None whatsoever. When I try to add a member function it says that the implementation is not found. I need the OnTextReceived event for instance, I can't find it anywhere. Not in the headers, not in the help that came with it either!
After a bit of searching on the MS Site I found a similar function DOES exist in the Exchange API, I don't see how those 2 are connected, if they even are...
Can anyone help me? Is it not possible in C to pull a trick like VB or Delphi? Just import the msmsgs.exe?
Thanks a lot,
- Fahr
|
|
|
|
|
Looking through the messenger sdk headers, there seems to be a lot of events although I can't see one for OnTextReceived.
Have you tried using #import on the Messenger Typelibrary and see if that generates the missing events. It is possible that the SDK uses an earlier/later version of the COM interfaces?
Michael
Fat bottomed girls
You make the rockin' world go round -- Queen
|
|
|
|
|
The main problem with that is that the actual typelibrary is in the msn executable... I have NO idea how to import it :S
Neither do I have any idea how to import type libs in C w/o header files in general :P
- Fahr
|
|
|
|
|
#import "C:\Program Files\Messenger\msmsgs.exe"
will generate you a header file for the typelib. I've checked with my version and it generates an event for OnTextReceived.
Michael
Fat bottomed girls
You make the rockin' world go round -- Queen
|
|
|
|
|
possibly and extremely stupid newby question: WHERE do I type the #import so it generates a class/header/whatever ??
I never worked with typelibs in C w/o having pre-made headers :S
Thanks,
- Fahr
|
|
|
|
|
#include "stdafx.h"
#import "C:\Program Files\Messenger\msmsgs.exe"
int _tmain(int argc, _TCHAR* argv[])
{
Messenger::IMsgrObject2Ptr oMsgrObj = NULL;
Messenger::IMsgrUsersPtr oUsers = NULL;
Messenger::IMsgrUserPtr oUser = NULL;
oMsgrObj.CreateInstance("Messenger.MsgrObject");
oUsers = oMsgrObj->GetList(Messenger::MLIST_CONTACT);
return 0;
}
Michael
Fat bottomed girls
You make the rockin' world go round -- Queen
|
|
|
|
|
Thanks an amazing bunch!! It works!!
Will it compile the exe along so I only need a running instance, or will it need the exe to be always in the same dir?
- Fahr
|
|
|
|
|
It only uses the exe to generate the msmsgs.tlh, msmsgs.tli files. The exe is just acting as the type library. As long as MS Messenger is on the machine that you install on, then your app will just run.
Michael
Fat bottomed girls
You make the rockin' world go round -- Queen
|
|
|
|
|
Also, I stumble upon the following error when I try to define the OnTextReceived function:
c:\program files\microsoft visual studio\myprojects\msntest\stdafx.cpp(23) : error C2084: function 'long __thiscall Messenger::DMsgrObjectEvents::OnTextReceived(struct Messenger::IMsgrIMSession *,struct Messenger::IMsgrUser *,class _bstr_t,class _bs
tr_t,short *)' already has a body
what am I supposed to do with that? I'm guessing it is redifined or something?? I don't get it...
Sorry if I sound too much like a noob, this is all just new to me :P
And on another note, can I make it like a class in my classview? It would be a lot easier I think...
Thanks,
- Fahr
|
|
|
|
|
Hi,
I wrote a class for an ownerdraw listbox (LBS_OWNERDRAWFIXED). When used as a child window, MeasureItem and DrawItem are correctly called.
When used as a popup, these methods are not called (neither OnMeasureItem and OnDrawItem in the owner window).
How to have an ownerdraw listbox used as a popup ??
Thanks
|
|
|
|
|
When i save my MDIDocument I want to speicify the Default File Extension for the Document. Where and how should i do it ?
|
|
|
|
|
I have this silly program I am doing for class. I want to add a vector to it but I get the below error.
I have added to my working program
#include <vector><br />
using namespace std;<br />
<br />
vector<CShape *> v;
and then get this error. With out the 3 lines my program works fine. I'm not even using the vector anyplace yet.
--------------------Configuration: CIS279_8 - Win32 Debug--------------------
Compiling resources...
D:\Program Files\Microsoft Visual Studio\VC98\INCLUDE/eh.h(32) : error RC2188: #error : "eh.h is only for C++!"
RC : fatal error RC1116 : RC terminating after preprocessor errors
Error executing rc.exe.
Creating browse info file...
CIS279_8.exe - 2 error(s), 0 warning(s)
Any Ideas?
Thanks,
Jeff Patterson
Programmers speak in Code.
www.anti-dmca.org
|
|
|
|
|
what is the name of the file to which you added the #include ?
is it foo.c or foo.cpp ?
-c
There's one easy way to prove the effectiveness of 'letting the market decide' when it comes to environmental protection. It's spelt 'S-U-V'.
--Holgate, from Plastic
|
|
|
|
|
|
something strange is going on here.
#include <vector>
<small>Jeff Patterson
Programmers speak in Code.
<a href="http://www.anti-dmca.org">http://www.anti-dmca.org</a>[<a target=_blank title='New Window' href="http://www.anti-dmca.org">^</a>]
</small>
|
|
|
|
|
you need to put source code inside <pre> tags (and put spaces around any angle brackets. otherwise, the CP boards eat them...
-c
There's one easy way to prove the effectiveness of 'letting the market decide' when it comes to environmental protection. It's spelt 'S-U-V'.
--Holgate, from Plastic
|
|
|
|
|
What is the extension of your source file? This error is similar to when you name a file .C and the C++ mode will be turned off. Be sure to name it C++ and check your project settings to be sure that C++ compilation is enabled.
My latest article:
SQL Server DO's and DONT's[^]
|
|
|
|
|
I was trying to include it in my created .h file.
Why must I include this in a cpp file and declare it in a .h file? It is working now but this seems nonstandard.
Am I missing something?
Thanks
Jeff Patterson
Programmers speak in Code.
http://www.anti-dmca.org[^]
|
|
|
|