afxwin1.inl - Debug Assertion Failed

I am running the debugger in VC++ 6.0.

It says the assert is on the following line (27):

{ ASSERT(afxCurrentAppName != NULL); return afxCurrentAppName; }

This happens when one of my dlls is executing.

I tried adding the following as a global in the main code, but this did not 
help.
CWinApp		MyApp("xxxx"); // attempted to remove assert

Also, I use multiple dlls.  One of the dll's uses MFC (not the new 
problematic one)  and is a normal dynamically linked dll. (use MFC shared dll 
and NO DllMain).

Any ideas on how to fix the assert?

TIA!




0
malhenry (9)
6/27/2005 5:31:05 PM
vc.mfc 33608 articles. 0 followers. Follow

2 Replies
1209 Views

Similar Articles

[PageSpeed] 59

Is it possible that you need to use the 
AFX_MANAGE_STATE( AfxGetStaticModuleState() );
in your exported DLL function that ends up calling (directly or 
indirectly) AfxGetAppName?

In article <BBA3AFA2-D9D6-43B4-BF04-D5DA1FC48467@microsoft.com>, 
malhenry@discussions.microsoft.com says...
> I am running the debugger in VC++ 6.0.
> 
> It says the assert is on the following line (27):
> 
> { ASSERT(afxCurrentAppName != NULL); return afxCurrentAppName; }
> 
> This happens when one of my dlls is executing.
> 
> I tried adding the following as a global in the main code, but this did not 
> help.
> CWinApp		MyApp("xxxx"); // attempted to remove assert
> 
> Also, I use multiple dlls.  One of the dll's uses MFC (not the new 
> problematic one)  and is a normal dynamically linked dll. (use MFC shared dll 
> and NO DllMain).
> 
> Any ideas on how to fix the assert?
0
6/29/2005 7:19:47 AM
Thanks for your post.  

I fixed the problem with the following two changes:
Change Project Settings > General from Not using MFC to Use MFC in a Shared 
DLL
in my dll that had the assertion failure
and
added the following line as a Global in the main .cpp file:
CWinApp		MyApp("xx"); // This removes Assertion failure on afxwin1.inl




"Scot T Brennecke" wrote:

> Is it possible that you need to use the 
> AFX_MANAGE_STATE( AfxGetStaticModuleState() );
> in your exported DLL function that ends up calling (directly or 
> indirectly) AfxGetAppName?
> 
> In article <BBA3AFA2-D9D6-43B4-BF04-D5DA1FC48467@microsoft.com>, 
> malhenry@discussions.microsoft.com says...
> > I am running the debugger in VC++ 6.0.
> > 
> > It says the assert is on the following line (27):
> > 
> > { ASSERT(afxCurrentAppName != NULL); return afxCurrentAppName; }
> > 
> > This happens when one of my dlls is executing.
> > 
> > I tried adding the following as a global in the main code, but this did not 
> > help.
> > CWinApp		MyApp("xxxx"); // attempted to remove assert
> > 
> > Also, I use multiple dlls.  One of the dll's uses MFC (not the new 
> > problematic one)  and is a normal dynamically linked dll. (use MFC shared dll 
> > and NO DllMain).
> > 
> > Any ideas on how to fix the assert?
> 
0
malhenry (9)
6/29/2005 9:38:02 PM
Reply:

Similar Artilces:

SP2 for windows xp download fails
Get error message stating "The procedure entry point for GetIUMS could not be located in the dynamic library link MSDART.dll" The message title is migrate.exe - Entry point not found How do I repair this problem?? Can't install latest virus protection without installing this SP Pendleton wrote: > Get error message stating "The procedure entry point for GetIUMS > could not be located in the dynamic library link MSDART.dll" > The message title is migrate.exe - Entry point not found > How do I repair this problem?? > Can't install latest viru...

createDIBsection failed
Hello! i'm using the following code which is supposed to display a BMP image on the screen. But the result is a black rectangle. CClientDC dc(this); CDC bmDC; bmDC.CreateCompatibleDC(&dc); HDC hDC = bmDC.GetSafeHdc(); BITMAPINFO bmInfo; bmInfo.bmiHeader.biSize = sizeof(BITMAPINFOHEADER); bmInfo.bmiHeader.biWidth = im_data->width; bmInfo.bmiHeader.biHeight = im_data->height; bmInfo.bmiHeader.biPlanes = 1; bmInfo.bmiHeader.biBitCount = 24; bmInfo.bmiHeader.biCompression = BI_RGB; bmInfo.bmiHeader.biSizeImage = 0; bmInfo.bmiHeader.biXPelsPerMeter = 0; bmInfo.bmiHeader.biYPelsPerM...

copy paste fail
I don't know what causes this but sometimes "paste" option on the right click is greyed. Not always but it is very irritating. There are several macros belonging to workbook. Can they be the reason ? How can i make "paste" option functional again. Any help ? Found it, trimming the code behind the sheet i want to paste to: Private Sub Worksheet_Activate() <----------------------------No good With ActiveWindow .DisplayGridlines = False .DisplayHeadings = False End With Application.Goto Reference:=Cells(1, 1), Scroll:=True ActiveSheet.C...

Certain SRS Reports Fail When MOSS Installed
We are running SP2 & AUG09 MS CU. We were just running with WSS, but then installed MOSS so we could use the more robust workflow. Since then are SRS reports that have an execute statement fail I posted the following on Developer stie about a week ago and got no responses. Just wondering anyone else run into this problem? We are running into errors with our SRS reports running in a test environment under MOSS. Reports that execute a stored procedure fail; those that don't are successful. One likely cause we have discovered is that our production environment has a dbo.MS...

afxwin1.inl ASSERT
Hello, I'm having a terrible problem with the debug (release builds are OK since the ASSERT macro isn't defined) builds of my project. All I want to do is create a new dialog box. I declare my object and call Create: MyObject.Create(IDD_X);. This causes an ASSERT failure on line 24 of afxwin1.inl. As I understand it, MAKEINTRESOURCE(IDD_X) is supposed to convert the integer code of my dialog into a string. However, the Create call seems to be failing because of a NULL pointer for the string value. However, everything works fine in the release build - the dialog comes up and wo...

afxwin1.inl line 26
I've created an MFC DLL that will be called by a non-MCF COM DLL. However, when regsvr32 registers the COM DLL it errors out in afxwin1.inl, line 26. If I set the MFC DLL to delayed, the COM DLL can be registered and runs. However, when the time comes to load the MFC DLL the load fails. My MFC DLL implements CPropertySheet and CPropertyPage. I've seen some references to needing the AFX_MANAGE_STATE(AfxGetStaticModuleState()) macro; I don't know if that's my problem or not. I'm not clear on where I should put it in any case. I've tried putting it in the C++ constructor...

CRM Server 3.0 setup SHGETFolder Path failed failed
Hi, i have a big problem since 2 days. I am new in MS CRM. I want to setup on my PC. But i coulnt install it. Started the installer under the server logged in as a domain admin,or Administrators.. I got the error as below: "SHGETFolder Path failed failed. For additional details seed logfile C:\documents and settings\administrator.mainoffice\application data\microsoft\mscrm\logs\crm30svrsetup.log" Could you help me. What is that? and how can solve this error? Thank you Serkan ...

Multiple email accounts fail after 6
1) I have a local isp but use a remote web hosting service that provides me with email accounts. I've set up Outlook 2002 to download mail from 6 accounts, but if I try to add any more I get the following error message: "Sending and Receiving' reported error (0x800CCC0F) : 'The connection to the server was interrupted. If this problem continues, contact your server administrator or Internet service provider (ISP).'" 2) The remote web hosting service says it is not there problem; many people have more than 10 emails through one web site. 3) The local isp say...

SP3 for Windows XP Failed
In reviewing my Windows Update History, I find that Windows XP Service Pack 3 Failed on 08 21 2008, but several Service Pack 3 Updates have downloaded since that date. Two Questions: 1) Why did the SP3 Update Fail, and 2) Why are the updates downloading and installing even though the Service Package Failed? This does not make sense. I just tried again to install it and it stopped downloading. Why? tkb656 wrote: > In reviewing my Windows Update History, I find that Windows XP > Service Pack 3 Failed on 08 21 2008, but several Service Pack 3 > Updates have downloaded sinc...

assertion problem in Mixed mode DLL
Pardon the cross post, but I'm not sure where exactly to post this question. We have MFC application using many MFC extention DLL's. We started using a new MFC extention DLL that is mixed mode so we could use some .Net components we have built. We are getting an assertion in ~CCmdTarget when exiting our app when after making a call to Windows Forms MessageBox. On line 48, m_dwRef is 2 for some reason. Offending line - System::Windows::Forms::MessageBox::Show("Test"); Is there some function I need to call to release something that I am missing? Any ideas? Thanks... Craig...

enable-mailPublicFolder failed
Hello, i am install a Exchange 2007 Server. I have enable a Public Folder as mailenabled. The Mail Public Folder doesnt work. The e-mail is in the Queue with the error: There is currently no route to the mailbox database. Can everbody help me? Thanks Ralf enable-mailpublicfolder "publicfoldername" -HiddenFromAddressListsEnabled $false set-mailpublicfolder -identity "publicfoldername" -EmailAddressPolicyEnabled $false set-mailpublicfolder -identity "publicfoldername" -PrimarySmtpAddress "email_publicfoldername" set-mailpublicfolder -identity ...

ODBC-call failed on Reporting Printing (After 7th page of 29 pages
Hi All, In some of our client machines we are getting ODBC-Call failed on printing a particular report on the 7th or 8th pages of the report. The report has 29 pages in total. The issue is happening if the amount of data is considerably huge (happening for 29 page report of 1600 records), but for lower amount of data, the are not facing it. Will there be any database access while printing the report ? Could you please give any pointer on why this is happening? MS-Access Version 2003, the report it is running on linked server tables of SQL 2008. Thanks Satya ...

How check if Application.Run fails??
Hello! I am using Application.Run to run macros in another workbook that is currently open. How can I check or test if the Application.Run function call fails or returns an error code?? Would it also be wise to use the "On Error Resume Next" before calling the Application.Run function?? thank you! Hi Robert, Firstly I assume that you mean you are running a Sub in another workbook; not a Function. A Function usually refers to User Defined Function (UDF for short). Now to check if the called Sub actually runs, insert a MsgBox with a message immediately a...

Assertion on FreeLibrary
Hello all, Not having to much luck with trying to write a regular plug in dll, latest problem is when I return from using the dll and do FreeLibrary: //in the calling unit: void CDynLoadTestDllsDlg::OnDoitButton() { LPCTSTR sTemp; typedef void (CALLBACK* LPFNCHNG)(CString,CString); typedef LPCTSTR (CALLBACK* LPFNLKUP)(CString); LPFNCHNG lpfnChng; LPFNLKUP lpfnLkUp; HINSTANCE hPI; hPI=LoadLibrary("D:\\CustPIs\\DLL_2.dll"); CString s1 = "sSrceServer"; CString s2 = "123.4.5.678"; if(lpfnChng = (LPFNCHNG)GetProcAddres...

ODBC --call failed
Hello all I change the ODBC (because we move to a new server) and now I am getting a "ODBC--call failed" error in some of my queries. What is the first thing I need to look at? everything should work just find since the name of tha tables are the same, data are the same everything is the same, it just a different ODBC name. The problem is ocurring in an append query, this is the error I am getting: ODBC--call failed. [Informix][Informix ODBC Driver][Informix]A syntax error has occurred. (#-201) What is weird is that I have a lot of other queries and they all work perfect. But I am...

Vsisual Studio 2005: Assertions when opening a dialog loading OCX
Hello, we get Assertions when opening a dialog loading OCX-Files as tabs. The ocx are compiled with Visual Basic 6 in general. Here is what I found out The assertion is located in C:\Program Files\Microsoft Visual Studio 8\VC\atlmfc\src\mfc\occcont.cpp: BOOL COleControlContainer::FillListSitesOrWnds(_AFX_OCC_DIALOG_INFO* pOccDlgInfo) { … COleControlSiteOrWnd *pTemp = new COleControlSiteOrWnd( hwndCtrl, pOccDlgInfo->m_pItemInfo[i].bAutoRadioButt...

Communication with the underlying transaction manager has failed
Hi! I´ve an appplication which uses transcation in com+ to communicate with an remote sql server database. This works fine on my windows 7 x86 "appserver", but on another station using Windows 7 x64 it fails with the message below. I don´t now if it has something to do with x86, x64. When saving to the database I got: System.Transactions.TransactionManagerCommunicationException was unhandled by user code Message="Communication with the underlying transaction manager has failed." Source="System.Data" StackTrace: at Syst...

Assert in afxwinforms.inl @ line 188
Hi, Visual Studio 2005 SP1, Windows XP Pro SP2 + umpteen updates. I'm getting the assert mentioned in the title of this message within my application. Its in: BOOL CWinFormsControl<TManagedControl>::CreateManagedControl(DWORD dwStyle, int nPlaceHolderID, CWnd* pParentWnd) I'm at a loss to understand what the assert is trying to point out to me and there's no explanatory text associated with it. I'm therefore struggling to find out what to do to resolve it. Can anyone who knows the MFC source code explain what the assert means? Regards David Razzetti ...

My workstation fails to connect to mailbox on Port25
I am trying to understand how the workstation where I have Out 2002 installed can communicate can send/receive e-mail from mailbox server if: I do telnet <mailbox> 25 and it appears: "Connection failed" If connection fails to Exchange server, how does Outlook work ? On Wed, 22 Dec 2004 15:54:57 -0800, "Marlon Brown" <marlon_brown@hotmail.com> wrote: >I am trying to understand how the workstation where I have Out 2002 >installed can communicate can send/receive e-mail from mailbox server if: > >I do telnet <mailbox> 25 and it appears: >...

Deploymt Mnger SnapIn Fails to Initialize
Howdy, I am receiving the following error when trying to launch the Deployment Manager: Snap-in failed to initialize I have admin privileges on the server. The snap-in works when using the admin account, but fails when using my other account (with admin privileges). Any ideas? Thanks, Justin Are both of your accounts assigned CRM user licenses? Mike "Justin" <anonymous@discussions.microsoft.com> wrote in message news:1d6001c3e03b$ef6a4fc0$a501280a@phx.gbl... > Howdy, > > I am receiving the following error when trying to launch > the Deployment Manager: &...

Failed upgrade from trail to standard
I installed the trail version of Exchange 2003 4 months ago. 1 month ago, I reinstalled to the standard version. Earlier this week, I removed the old Exchange 5.5 server as the server was "dying" and I had turned off the services for it 2 weeks ago. I followed all of the posted procedures for removing last Exchange 5.5 server. Now I am receiving an error message that the trial license has expired! I tried to reinstall the standard version and it won't let me as site replication serice won't start (since Exchange 5.5 is now gone!) I have no idea of where to go fro...

Rebuilding MFC and .inl file handling
Hi folks. We also have been bit by the VS.Net 2003 bug where CFile::GetFileName(), CFile::GetPathName(), and CFile::GetStatus() throw an exception when reading a file from a CD-ROM drive (due to an exception thrown in one of the CTime constructors within CFile::GetStatus). Since we have to recompile the MFC source already anyway (we're using Unicows), we figured we'd try editing the atltime.inl file and recompiling MFC. In debug mode, we reasoned, atltime.inl finds its way into a library, so linking to a version of MFC with that code changed would solve our problem, right? Well, wr...

gethostname method fails
Greetings! I am using the following method to get the host name of my computer in an application. But it does not do so and ends up giving me error 10093 (WSAGetLastError()). I have no clue as to what is happening. Can anyone please help. Many thanks in advance. Best regards, gethostname(name, sizeof(name)); error 10093 is WSANOTINITIALISED. You should make a WSAStartup() call before using gethostname() { generally during application start and do not forget to call WSACleanup() when you application exits } -- Cheers Check Abdoul [VC++ MVP] ----------------------------------- &qu...

Business Contact Manager Fails to Install
I too had problems, and had to uninstall BCM. I'm not even sure it was fully uninstalled, I had problems with that as well. I am running Office Pro2003, and currently using Outlook, sans the BCM. My installation of BCM gets all the way to almost the end, then rolls back. I am totally frustrated, have visited several user groups, but no luck I do have an email account set up in Outlook, and one post mentioned getting rid of Exchange Server from Small Business, but I'm not even sure what that is. I do have .Net Framework installed, and MSDE. Can anyone help me before I rip all my ha...

ASSERT
The WM_CREATE documentation says that: Return Value If an application processes this message, it should return zero to continue creation of the window. If the application returns 1, the window is destroyed and the CreateWindowEx or CreateWindow function returns a NULL handle ...but if I return 1, the window is not destroyed. What is wrong? The return value for a failed creation is -1, not 1, it's also what the documentation says, i believe that's the problem. "Ander" <a69032@gaviota.tecnun.es> escribi� en el mensaje news:059301c37059$5f1b49d0$a101280a@phx.gbl...