activex

How to compare BSTR against a string in c/c++?

扶醉桌前 提交于 2019-12-01 03:04:47
wprintf(L"Selecting Audio Input Device: %s\n", varName.bstrVal); if(0 == strcmp(varName.bstrVal, "IP Camera [JPEG/MJPEG]"))... The above reports : error C2664: 'strcmp' : cannot convert parameter 1 from 'BSTR' to 'const char *' Brian R. Bondy You have to use wcscmp instead: if(0 == wcscmp(varName.bstrVal, L"IP Camera [JPEG/MJPEG]")) { } Here is a description of the BSTR data type , it has a length prefix and a real string part which is just an array of WCHAR characters. It also has 2 NULL terminators. The only thing to look out for is that the BSTR data type can contain embedded NULLs in the

How do I resolve “Run-time error '429': ActiveX component can't create object”?

↘锁芯ラ 提交于 2019-12-01 03:01:56
My company has a VB6 application using Crystal Reports 7 which a client has asked to be installed on Windows 7 32 bit. It is currently installed on Windows XP 32bit SP2 machines at the client. Connection to the DB is done via ODBC to SQL Server 2000 instance on another server. On Windows 7, the installation works fine, however when you try to open the application, the error is given. I have looked at the following: Registering all the dll's and ocx files using regsvr32. Some will not register as they either are registered already or the following message is given "Make sure that "[name].dll"

Create CAB file for ActiveX installation for IE

前提是你 提交于 2019-12-01 02:11:19
问题 I created a cab file that contains my activex using CABARC.exe. I also created an .inf file. My inf file looks like this: [version] signature="$CHICAGO$" AdvancedINF=2.0 [Add.Code] MySetup.exe=MySetup.exe [MySetup.exe] file-win32-x86=thiscab clsid={49892510-B520-4b35-8ADF-57084DD2F717} My html looks like this: <object name="secondobj" style='display:none' id='TestActivex' classid='CLSID:49892510-B520-4b35-8ADF-57084DD2F717' codebase='http://myurl/MySetup.cab#version=1,0,0,0'></object> I

System.Windows.Forms.AxHost.InvalidActiveXStateException was unhandled

荒凉一梦 提交于 2019-12-01 01:24:11
问题 I am continuously struggling with this exception An unhandled exception of type 'System.Windows.Forms.AxHost.InvalidActiveXStateException' occurred in AxInterop.SBXPCLib.dll any help please, am i missing some thing. 回答1: Try this,it will solve your problem: For each and every active x control, it is needed to create it first, so that all the events and handles should be initialized. So try this: axMDocView1.CreateControl() 回答2: The answer by Vishal is Fulfill your requirement but here I

How to CreateObject in C#?

别说谁变了你拦得住时间么 提交于 2019-12-01 01:10:16
I want to translate the following VB6 code into C# If optHost(0).Value Then Set m_oScpiAccess = New IcSCPIActiveX.IcSCPIAccess Else sHost = txtHost.Text Set m_oScpiAccess = CreateObject("Exfo.IcSCPIActiveX.IcSCPIAccess", sHost) End If I used TlbImp.exe to create wrappers for the COM classes, and I tried: if (string.IsNullOrEmpty(host)) { // this works IcSCPIAccess = new IcSCPIAccess(); } else { // throws MissingMethodException IcSCPIAccess = (IcSCPIAccess)Activator.CreateInstance( typeof(IcSCPIAccessClass), host); } But there is no constructor which accepts the host parameter It is not a

How to compare BSTR against a string in c/c++?

你说的曾经没有我的故事 提交于 2019-11-30 23:21:01
问题 wprintf(L"Selecting Audio Input Device: %s\n", varName.bstrVal); if(0 == strcmp(varName.bstrVal, "IP Camera [JPEG/MJPEG]"))... The above reports : error C2664: 'strcmp' : cannot convert parameter 1 from 'BSTR' to 'const char *' 回答1: You have to use wcscmp instead: if(0 == wcscmp(varName.bstrVal, L"IP Camera [JPEG/MJPEG]")) { } Here is a description of the BSTR data type, it has a length prefix and a real string part which is just an array of WCHAR characters. It also has 2 NULL terminators.

Improve performance of Search Replace in Word document using OLE and Delphi

↘锁芯ラ 提交于 2019-11-30 23:15:03
问题 After some experiments I ended up with the following code to perform Search and Replace in MSWord. This code works perfectly also in header and footer, including the cases in which header and/or footer are different for the first page or odd/even pages. The problem is that I need to call MSWordSearchAndReplaceInAllDocumentParts for every string I replace, and I get an unacceptable performance (2 minutes for about 50 strings in a 4 pages doc word). Ideally it should be "instantaneous" of

Register ActiveX exe server using WiX

吃可爱长大的小学妹 提交于 2019-11-30 22:39:29
I have several VB6 ActiveX server exe files which need to be registered on install before they can be used. I have tried using Heat to extract the information but it only generates a file element. These files can be registered by calling them with the /regserver switch and unregister by calling them with the /unregserver switch. I understand this is not the correct way to this. Instead I should add the registry keys and other required elements to my wix source. My question is how do I find out what registry keys and other element I require to register these ActiveX exe files. Seeing as Heat

Creating and deploying an ActiveX control in .NET

谁都会走 提交于 2019-11-30 21:23:49
Since there is apparently no Flash control that can accept bitmap pastes , I want to think about writing one myself. I'd rather not use Flash though, so I though about using .NET. Now I believe the correct terminology for a native code control that can be downloaded and run in the browser is "ActiveX control". So my question is, can I create such an ActiveX control with .NET? I've found some tutorials on the web, but they all expect you to have the assembly installed on your local machine, and registered and trusted both it and the website that's accessing it. This is asking a bit much for

Security Level for WebBrowser control

对着背影说爱祢 提交于 2019-11-30 20:45:22
I am trying to migrate an .hta application to a C# executable. Of course, since it's an .hta the code is all HTML and Jscript , with calls to local ActiveX objects. I created a C# executable project and am just using the WebBrowser control to display the HTML content. Simply renamed the .hta to an .html and took out the HTA declarations. Everything works great, except that when I make calls to the ActiveX objects, I get a security popup warning of running an ActiveX control on the page. I understand why this is happening since the WebBrowser control is essentially IE and uses the Internet