Visual C++ :: Debug Assertion On ActiveX Create

Oct 10, 2013

I have a MFC Com Dll that has a CDialog. In the OnCreate event I create an ActiveX control. The dll is hosted inside an executable of mine. In this scenario everything works fine!

The dll is also called from an external executable and then a Debug Assertion in OCCSITE.cpp occurs when I create the ActiveX control. I suspect that in the executable there is no AfxOleInit. I spend some time with this problem and tried to CoInitialize, OleInitialize, AfxOleInitModule and even AfxOleInit in the dll. But all that does not change a thing. If I understand the mechanics then this is an intended behaviour and should be done in the host exe.

What I observed in the OCCSITE.cpp:

Code:
_AFX_THREAD_STATE* pState = AfxGetThreadState();
if (!pState->m_bNeedTerm && !AfxOleInit())
return hr;

In my executable m_bNeedTerm is 0 and in the external one (where the ActiveX does not work) it is -1. In AfxOleInit this is explained as a special flag to prevent the dll from doing an unnecessary OleInitialize. But as I said even if I call OleInitialize myself I get the Debug Assertion and the ActiveX is not visible.

Is there anything I can do to make the ActiveX control work in the external application? Obviously I cannot Change anything in the application...

View 1 Replies


ADVERTISEMENT

Visual C++ :: Debug Assertion Failed With MessageBox

Mar 22, 2014

I am trying to use MessageBox in OnInitialUpdate function but its giving me "Debug Assertion Failed Message"

File: f:ddvctoolscrt_bldself_x86crtsrcvsprintf.c
Line:244

I am using the following code:

Code:
void CRotateImageView::OnInitialUpdate() {
int k;char str[2];
CView::OnInitialUpdate();
CString szStr,szstr1;

[Code] .....

However when i am using the same code in OnDraw its working.

Code:
void Csprintf_sEGView::OnDraw(CDC* /*pDC*/) {
Csprintf_sEGDoc* pDoc = GetDocument();
ASSERT_VALID(pDoc);
if (!pDoc)
return;

[Code] ....

View 3 Replies View Related

Visual C++ :: Debug Assertion Failed Due To Use Of Ifstream

Mar 11, 2014

I am trying to run the code below but I receive the following error message :

Debug Assertion Failed!
Program: C:TestDebugTest.exe
File: c:program filesmicrosoft visual studio 10.0vcincludevector
Line:932

Expression:vector subscript out of range

Code:
#include <fstream>
#include <cstdlib>
#include <iostream>
#include <strstream>
#include <cstring>
#include <cmath>
#include <map>
#include "Swap.h"
#define SIZE_X 100

[Code] .....

View 14 Replies View Related

C++ :: Write Data Into Files In A For Loop - Debug Assertion Failed?

Apr 14, 2012

In my program I open two files and write data into each, and close them. this is done in a while loop.

int main() {
while() {
myFile = fopen("file1.txt","w");
myFile2 = fopen("file2.txt","w");
// write data into files using fprintf() in a for loop
fclose(myFile);
fclose(myFile2);
}
}

However, after some iterations the fopen() for myFile2 fails.

Debug assertion failed!
Program....
File ......srcfprintf.c
Line 55

Expression (str != NULL)

I have not been ableto locate the bug in the code that is causing the failure.

View 7 Replies View Related

Visual C++ :: Calling Function From OnDraw - Runtime Assertion

Feb 2, 2014

Following function is causing run-time assertion. I am using VC6.0 professional version. My OS is Win7.0. I am calling the function from OnDraw. OnDraw does not contain any other code other than the function call code:

Code:
void CMoireUseCirclesView::UseCircle(CDC* pDC){
int x1, y1, x2, y2;
x1=20;
y1=100;
x2=200;
y2=280;
int color1=0;
int color2=0;

[Code] ....

The assertion is occurring at:

Code:
newPen.CreatePen(PS_SOLID,5, RGB(color1,color2,color3+i));

The error message is:

Debug Assertion Failed
Prog:....
File:wingdi.cpp
Line:1120

Debug is giving following values

Loaded 'ntdll.dll', no matching symbolic information found.
Loaded 'C:WindowsSysWOW64kernel32.dll', no matching symbolic information found.
Loaded 'C:WindowsSysWOW64KernelBase.dll', no matching symbolic information found.
Loaded symbols for 'C:WindowsSysWOW64MFC42D.DLL'

[Code] ...

View 7 Replies View Related

Visual C++ :: ActiveX For Video Server

Jan 13, 2015

I would like to know in which way is the best to make ActiveX control for video. ActiveX control will need at least show picture and be able to go back in past, change resulation of picture and similar. How complex it is to do something like that? Is MFC best way to make it? Is there somewhere similar code?

View 2 Replies View Related

Visual C++ :: Adobe ActiveX Integration

Mar 17, 2014

I'm trying to open PDF file in my MFC application. For this I have installed Adobe Reader 10 and added the ActiveX from resource editor to my dialog.

Created a variable of that type and trying to use that. Class wizard has generated "class CPdf1 : public CWnd" for me and that's added to project.

Now when I'm trying to create the control window getting Assertion failure. Using the below code in my OnInitDialog / some button clicks.

Code:
m_PDF.Create(_T("Reader Window"), WS_CHILD | WS_VISIBLE, CRect(0, 0, 200, 300), this, 2009);

Am I missing some steps ?

View 4 Replies View Related

Visual C++ :: Passing Pointer Into ActiveX Control?

Oct 21, 2012

I'm writing an ActiveX control. In one of the functions I'd like the user to be able to pass me a pointer to a buffer that they created which I can then fill with data and return a success/error code. What's the appropriate way to do this? I was thinking about just using an OLE_HANDLE type for the parameter and then casting that to pointer inside the OCX but I'm not sure if that's safe or the right way to do it.

View 2 Replies View Related

Visual C++ :: Automation MS Word In ActiveX Container

Jan 20, 2014

I`m working with MS Visual Studio 6. Trying to connect Word server with my window. This is call server in my class CXContainerView, inherit from CScrollView:

Code:
void CXContainerView::CreateWord() {
::CoInitialize(NULL);
_Document doc;
_Application m_app;
LPDISPATCH lpDisp;
CLSID clsid;

[Code] ....

It works in debug version but falls in release. Feels my fifth point, what I call it in the wrong way.

View 6 Replies View Related

Visual C++ :: How To Add Images To Toolbar Buttons For Activex Control

Aug 8, 2013

//#import "c:windowsSysWow64mscomctl.ocx" raw_interfaces_only //in window7

using namespace MSComctlLib;
CComPtr<IButtons> pButtons;
CComPtr<IButton> pButton;
CComPtr<IImages> pImages;

[Code] ....

View 11 Replies View Related

Visual C++ :: Resource Editor Failed To Initialize ActiveX

Feb 27, 2014

I'm working on a project which consists of several ocx loaded by one exe. The platform is WinCE. Now I'm on a process to create a new ocx. I do have a copy of those ocx projects in Win32 platform. These Win32 versions were only used to register ocx in local system and then put those on to application dialog by 'Insert ActiveX'.

Now the problem is those Win32 projects are so outdated, and unable to build. Getting too many linking errors to be solved.

I have build the new ocx and link that with exe manually by editing .rc file and all. But still no luck. New ocx is getting registered in WinCE device but failing to start application.

View 6 Replies View Related

Visual C++ :: Is It Worthwhile To Write ActiveX Module Dedicated To Drawing Charts

Oct 22, 2014

I know the user installation must involve some registry manipulations and some other trickery. But the ActiveX way seems to be more modular.

Is it worthwhile to separate the charting modules from the exe and make an activex dll for this purpose?

View 5 Replies View Related

Visual C++ :: ActiveX Web Browser Control Not Deleting Session Cookies Even After Closing

Aug 9, 2013

I have an C++ application which uses Microsoft Web browser ActiveX control to launch any URL within the application. The browser is embedded in C++ form and It's working fine with all the feature Microsoft has exposed through Interface(IID_IWebBrowser2).But while any url that is using session cookie has been launched, even after closing the browser the session cookies are not getting deleted. For example if user login info is stored as session cookies,the url is using the cookies and getting launched without asking for user log in info.

But if I close the browser, and again relaunch , the cookies should be deleted and the url will not find the cookies to be used for log in . That is not happening here. Although this is session cookies , it's not getting deleted and being used by embedded browser. However, if the url is launched in IE, it is behaving as expected.

So, Do I need to delete the cookies explicitly? If Yes, How to do that?

View 2 Replies View Related

Visual C++ :: How To Recover Debug Symbols

Oct 6, 2013

The breakpoints I am setting are not caught by the IDE. Any how I can recover that.

I used to know I can delete the sdf file and rebuild. Just to make sure...

View 4 Replies View Related

Visual C++ :: How To Debug Win32 Message Loop

Sep 28, 2014

You place a breakpoint at one of locations within the message loop. But I want the breakpoint to trigger when I click on the application window, for example. But I can't, it went so fast so long as I switch from VS to the application program, the breakpoint is hitted again, then the application is frozen again. I don't know how to setup a conditional breakpoint.

View 3 Replies View Related

Visual C++ :: Does Not Contain Debug Information - Press OK To Continue

Sep 18, 2012

i changed my code from release to debug mode. when i try to debug it shows a dialog box that '... does not contain debug information press ok to continue"..

View 8 Replies View Related

Visual C++ :: Slow To Load Application With Windows Debug Symbols?

Dec 31, 2013

I dumped all symbols into C:WindowsSymbols folder, It takes more than 2 minutes to load an application which really surprises me. Why and when should I use those symbols?

View 1 Replies View Related

Visual C++ :: How To Make Bit Of Code Compatible With Both Debug And Release Builds

Aug 10, 2014

This code compiles in release mode but I get this compile error in debug mode:

Error1error C2664: 'GetPrivateProfileStringA' : cannot convert parameter 4 from 'wchar_t [255]' to 'LPSTR'g:easywebstoreuploaderini.cpp45

Code:
CString CIniFile::getKeyValue(CString strKey, CString strSection) {
wchar_t ac_Result[255];

// Get the info from the .ini file
m_lRetValue = GetPrivateProfileString(strSection, strKey, _T(""), ac_Result, 255, m_strFileName);

CString strResult(ac_Result);
return strResult;
}

View 3 Replies View Related

Visual C++ :: Debug Occasionally Brings Up Disassembly Rather Than Windows Files?

Jan 15, 2013

On fairly rare occasions, when attempting to debug one of my MFC applications on VS 2010, a compilation error is encountered, and instead of bringing up the customary Windows or MFC file with a arrow pointing to the problem, a disassembly appears with an arrow pointing to one of the assembler instructions.

Since Windows assembly language is hardly my forte, I do not know how to interpret the error. Furthermore, the Output usually indicates one or more 'first chance exceptions' but little more, and the Stack output usually quite sparse and often refers cryptically to some ntdll.dll!7c92a82c().

How can I better define the compile error?

View 4 Replies View Related

C++ :: Error Message - Assertion Failed

Nov 12, 2013

I got this message after i delete allocated class object, should i check the deleting? if it's object what is the correct way to delete/delete[]?

theCars[nToDel] is a static array of pointers

bool Cars::deleteElement(int nToDel) {
if (theCars[nToDel] != NULL) {
delete[] theCars[nToDel];
theCars[nToDel]=NULL;
inUse--;
return true;
} else
return false;
}

View 3 Replies View Related

C++ :: Password Verification Program - Assertion Error

Aug 23, 2014

I am trying to build a program that takes a user password (6+ characters, One uppercase, one lower case, and one number), and checks for errors. The idea is that if the user is doing something wrong (say, forgetting to use an uppercase letter), the program will tell them what the error is, and prompt them to enter the program again.

I get through the building process without errors, but whenever I run the program, I get this error: [URL] ....

Here is my code:

#include <iostream>
#include <cctype>
using namespace std;
bool checkPass(char [], int); //Password Checking Function
char convert(string);

[Code] ....

According to the box, the error appears on line 56 and 68.

View 5 Replies View Related

C# :: ActiveX Control In Separate Thread

Jun 19, 2014

I have a method that does some extensive work (retrieves a list of emails from an imap server). What i wanted was to add a flash movie that would start playing when the method is entered and will stop when the method finishes. Something like this:

private void RetrieveMails() {
PlayFlashMovie();
RetrieveMailsFromServer{};
StopFlashMovie();
}

The flash movie plays, but the speed is horrible, almoust frame by frame (it actually matches the stepping of the foreach method that fetches the mails from the server as i can see it retrieving one mail - the movie plays one frame and stops; retrieves another mail - the movie plays another frame and stops.).

In the loop that retrieves the messages, i added Application.DoEvents(); so that is not the problem.

Now i am thinking of somehow playing that flash movie on a separate thread that will not hang synchronous with the retrieving mails loop but i don't know how would i do that...

View 2 Replies View Related

C :: Passing Three Command Line Arguments - Assertion Failed Error

Feb 14, 2013

I am using visual studio 2012 and i pass three command line arguments as 10 20 30 and when i m compile the program get error.....

Code:

#include<stdio.h>
#include<conio.h>
#include<stdlib.h>
main(int n,char **p) {
int sum=0,i;
if(n>=2)

[Code] .....

View 2 Replies View Related

C++ :: Coding And Debug Time Per LOC

Mar 23, 2013

I just spent 3 hours writing and debugging 37 lines of code. Is this normal or am I "below average" in coding abilities. I come from a C background and decided to write C++ code that I finally got right as shown below for the specific example:

Code: #include <iostream>
#include <fstream>
#include <string>
#define SPACE_SEARCH 10
using namespace std;

[code].....

I think it was more the learning along the way that consumed atleast 75% of my time for this specific case. But then again, I read that programming always entails learning along the way and so its somehow no excuse for the long time taken in this specific case.

So as a matter of interest, what pace do all of you operate on, on average? i.e. LOC/day, Debugs per day or any other indicator of productivity?

View 3 Replies View Related

C/C++ :: Debug Executable That Needs Flags

Mar 20, 2015

I'm trying to step through the machine instructions of a c program. This program needs to be run with a -t flag.

This is what I tried
gdbtui
file prog
layout asm
start
stepi

When I try 'file prog -t' it doesn't work.

View 4 Replies View Related

C/C++ :: Debug Log Size Restrictions?

Dec 26, 2012

Iam creating one debug log in my c++ application through the below code.

file *log;
log = fopen("C:snmpApplicationlog.txt", "w");  

iam writing the statements in to this log by using fprintf(). As the .exe where i have put this mechanism runs continuously,the size of log file is increasing gradually.

1)If there is any way to restrict the Log file size,if the file reaches the mentioned size,the file should be discarded and logging should be done in another file with the same name.

{OR}

2)Put a time interval,once after that interval is elapsed, a new log file should be created.

View 1 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved