Error Cannot Initialize Ole Wxwidgets
C++ Development Search Cannot Initialize Ole If you are using the main C++ distribution of wxWidgets, Feel free to ask any question related to wxWidgets development here. This means questions regarding to C++ and wxWidgets, not compile problems. Post Reply Print view Search Advanced search 4 posts • Page 1 of 1 Balkis In need of some credit Posts: 9 Joined: Tue Sep 11, 2007 4:54 pm Cannot Initialize Ole Quote Postby Balkis » Tue Sep 11, 2007 5:03 pm Hi, I'm getting this error: Cannot Initialize Ole the code works, but still i'm receiving this error, if i change the properties to no common language runtime support the error will probably disappear. But i can Top Benjamin In need of some credit Posts: 2 Joined: Mon Oct 29, 2007 1:18 pm Location: The Netherlands Contact: Contact Benjamin Website Quote Postby Benjamin » Mon Oct 29, 2007 1:30 pm Hi Balkis, Did you solve the problem, because I got the same over here. I tried to run the "Minimal wxWidgets sample" from the book "Cross-Platform GUI Programming with wxWidgets" but I got a wxWidget pop-up telling me it cannot initialize the OLE. After surfing the web I could not find any solution. My system is: Platform : Windows XP SP2 IDE : MSVC++ 2005 Express SDK : Microsoft Platform SDK for Windows Server 2003 R2 wxWidgets : 2.8.6 Although it might be unrelated I'll post the compilation output: 1>------ Build started: Project: minimalTest, Configuration: Release Win32 ------ 1>Compiling... 1>MyApp.cpp 1>C:\wxWidgets-2.8.6\include\wx/log.h(601) : warning C4793: 'vararg' : causes native code generation for function 'void wxLogDebug(const wxChar *,...)' 1> C:\wxWidgets-2.8.6\include\wx/log.h(601) : see declaration of 'wxLogDebug' 1>C:\wxWidgets-2.8.6\include\wx/log.h(602) : warning C4793: 'vararg' : causes native code generation for function 'void wxLogTrace(wxTraceMask,const wxChar *,...)' 1> C:\wxWidgets-2.8.6\include\wx/log.h(602) : see declaration of 'wxLogTrace' 1>C:\wxWidgets-2.8.6\include\wx/log.h(603) : warning C4793: 'vararg' : causes native code generation for function 'void wxLogTrace(const wxChar *,const wxChar *,...)' 1> C:\wxWidgets-2.8.6\include\wx/log.h(603) : see declaration of 'wxLogTrace' 1>Linking... 1>Generating code 1>Finished generating code 1>MyApp.obj : warning LNK4248: unresolved typeref token (01000017) for 'wxVideoMode'; image may not run 1>MyApp.obj : warning LNK4248: unresolved typeref token (01000018) for '
here for a quick overview of the site Help Center Detailed answers to any questions you might have Meta Discuss the workings and policies of this site About Us Learn more about Stack Overflow the company Business Learn more about hiring developers or posting ads with us Stack Overflow Questions Jobs Documentation Tags Users Badges Ask Question x Dismiss Join the Stack Overflow Community Stack Overflow is a community of 4.7 million programmers, just like you, helping each other. Join them; it only takes a minute: Sign up OleInitialize fails when Common Lanuage Runtime is enabled? up vote 1 https://forums.wxwidgets.org/viewtopic.php?t=15915 down vote favorite I am working on a wxWidgets console application that I want to call into = a C# DLL from, via the CLR. Unfortunately, the application hiccups in the wxWidgets application initialization code because OleInitialize is failing. The error I'm seeing is a pop-up simply stating "Cannot initialize OLE." It seems that this problem is usually avoided by setting the apartment style for threads by applying a http://stackoverflow.com/questions/1396267/oleinitialize-fails-when-common-lanuage-runtime-is-enabled directive to the application's entry point but I'm really struggling with what entry point I'm looking for. My C# code is a DLL: there's no specific entry point. The code compiled with /CLR exists in a .lib which is linked into my wxWidgets application. wxWidgets actually defines the WinMain in their code, and allows me to override behaviors via implementing wxApp. Other suggestions include disabling OLE support in wxWidgets but In my release, 2.8.6, setting wxUSE_OLE, wxUSE_CLIPBOARD, wxUSE_DATAOBJ, wxUSE_DRAG_AND_DROP to 0 creates unresolved externals while compiling wxWidgets. Has enjoy encountered this before and found an effective work around? Can anyone provide any clarification on what entry point I need to be modifying? c++ clr wxwidgets share|improve this question edited Sep 10 '09 at 17:19 asked Sep 8 '09 at 20:50 antik 4,11912244 add a comment| 1 Answer 1 active oldest votes up vote 0 down vote accepted As mentioned in my question, this is a problem involving the thread style settings between the C++ application and the CLR defaults. This was apparently a bug, once upon a time, and Microsoft has released a fix: http://msdn.microsoft.com/en-us/library/s6bz81ya.aspx Recompiling the executable the uses the CLR-enabled .lib with /CLRTHREADATTRIBUTE:STA was sufficient to eliminate the errors I was seeing. share|impr
1 New Topic/Question Reply 3 Replies - 2495 Views - Last Post: 06 September 2012 - 03:20 PM Rate Topic: #1 lattimer1999 New D.I.C Head Reputation: 2 Posts: http://www.dreamincode.net/forums/topic/291143-wxwidgets-error-cannot-initialize-ole/ 8 Joined: 02-December 11 wxWidgets Error: Cannot initialize OLE Posted 06 September 2012 - 01:09 PM Code works great but once i call this sub the first time i get a wxWidgets that says Error: Cannot initialize OLE and if you hit OK the sub and the whole application runs fine. Can someone please help me in getting the error to error cannot go away. Dim cmd As New Data.Odbc.OdbcCommand Dim da As New OdbcDataAdapter(cmd) connetionString = "Data Source=NHOSQLSTRAT;Initial Catalog=CLS_DATA;Trusted_Connection=Yes " connection = New SqlConnection(connetionString) Dim conn As New OdbcConnection("DSN=CLS Data v2") connection.Open() SQL = "DELETE FROM " & tablename adapter.DeleteCommand = New SqlCommand(SQL, connection) adapter.DeleteCommand.ExecuteNonQuery() connection.Close() strclsquery = "SELECT * FROM " & tablename conn.Open() cmd.CommandTimeout = 72000 cmd.CommandText = strclsquery cmd.Connection = conn error cannot initialize subjectsTable = New Data.DataTable da.Fill(subjectsTable) conn.Close() Is This A Good Question/Topic? 0 Back to top MultiQuote Quote + Reply Replies To: wxWidgets Error: Cannot initialize OLE #2 _HAWK_ Master(Of Foo) Reputation: 1161 Posts: 4,444 Joined: 02-July 08 Re: wxWidgets Error: Cannot initialize OLE Posted 06 September 2012 - 01:56 PM You have 2 diff type of connections - do you need both? You are also calling conn.Open() before you set it's properties - most likely the cause for the error. If you use Try/Catch blocks an check the exception for the details it will greatly help you out with errors. You should always wrap connections with Try/Catch blocks - there are several ways to get errors that you can not control. This post has been edited by _HAWK_: 06 September 2012 - 01:57 PM Was This Post Helpful? 0 Back to top MultiQuote Quote + Reply #3 lattimer1999 New D.I.C Head Reputation: 2 Posts: 8 Joined: 02-December 11 Re: wxWidgets Error: Cannot initialize OLE Posted 06 September 2012 - 02:47 PM I have moved the Conn.open and put a