Home » Microsoft Technologies

How to use pdf.ocx control in VB 6.0

My other problem I can print the pdf file by using the printWithDialog method,but It need to run the Acrobat Application first and then It'll show the printer dialog box. How could I just wanna open only the printer dialog box?

Anybody have any solution?

Thanks you in advance.


2 Answers Found


Answer 1

Hi New_CBH,

you can run the Acrobat Application in the background.

AcrobatApp.Visible = False
So, nobody see, what you do and you can use the printWithDialog method.

Answer 2

Could I ask some question more? I do want u to tell me the object of the Variable AcrobatApp.

Thanks you in advance.


hi friends i want to create a new ocx control in c# and the same thing i want to embed in web application please tell me its urgent and i came to know we can develop ocx controls in vb but i am unable to do in .net help me out

thanks in advance

Hello Everybody. My other problem I wanna reduce the pdf file size with AcroPDF control in vb 6.0 project, but I can't find the solution to do it. Anybody got any solutions?please help me.

Thanks you all in advance.


·         I have an activex control created in VB6, which stores some of its properties with the help of "ocxstate". As part of migrating, we are facing some issues for ugrading this VB6 activex control to VB.NET. The activex control inherits maskteditextbox and in addition to that we have implemented some more properties.

Since we are not able to get some of the properties stored in ocxstate, it creates problem mapping the design values of properties in VB6 to VB.NET.

Is it possible to get the values stored with the help of ocxstate in VB.NET? If so how can we get this values.

Help needed ASAP.


Hi All

I have a printpreview / print ActiveX control that I've added to my .NET form (it is a legacy component) and everything is working perfectly in the printpreview mode.

There is one method that requires the VB6 Printer object, which I've been able to create with the help of the VisualBasic Printing Compatibility Power Pack (Microsoft.VisualBasic.PowerPacks.Printing.Compatibility.VB6).

When I try to pass it to the method however, I get an InvalidCastException.

Example (Just relevant lines):

Imports Microsoft.VisualBasic.PowerPacks.Printing.Compatibility.VB6
Public Printer AsNew Printer
MessageBox.Show(Printers.Count) ' Success - I get an integer value
Doc.Output(Printer) ' InvalidCastException

Doc.Output is expecting an object; a VB6 Printer object. What am I doing wrong?


I converted a VB6 application in VB.net 2008 by using VS 2008 conversion wizard I have encountered a problem in using Tab control in VB.net. I used “Microsoft TabStrip Control 6.0 (SP6)” in VB 6 project. VB.net converter wizard converted it properly and add reference to “AxInterop.MSComctlLib.dll” and “Interop.MSComctlLib.dll”. I am using TabStrip on a Form that is use “Hide” instead of “Close”. So problem is when this form shown again following instruction raises exception:

a = tbsMain.SelectedItem.Index 

Exception: NullReferenceException was unhandled “Object reference not set to an instance of an object.”

But when I browse the selected item’s index value using “Quick Watch” option (while debugging) it returns the correct index instead of nothing value. I am unable to understand what is the problem and is restricted to use only this control. While debugging when I browse SelectedItem property in “tbsMain”, it contains an object of “MSComctlLib.TabClass”, I think when “Hide” the Form reference of this object’s memory location is lost but this is just an assumption.



Hi,this is my first post here.

I want to show word document inside vb.net mdi child form.I learned it is not available in vb.net 2008(i am using it)and alternative could be Dsoframer.ocx.

But i dont know how to integrate it in vb.net and load the file inside form.Sample code might really help me.


We hava a legacy COM OCX written in C++ using MFC and compiled with Visual Studio 2008. The OCX is compiled as multi-byte and not Unicode. At the moment, conversion to Unicode is not an option.

We are having problems with keyboard input when the keyboard is non-english, notable ones that use Latin-2 such as the Czech keyboard.

We change the curent keyboard mapping in Windows to the Czech keyboard layout. The latin-2 keys are assigned to the keys 2 - 5 on an English keyboard. The non-Unicode program Language setting is set correctly (e.g. Czech, Russian) in the Regional settings.

If we display the control in the Microsoft test harness or a browser, the input of said characters works fine (i.e. I press the key for e and I get e).

If I import the OCX into Visual Basic .NET 2008 (which automatically creates a COM Interop wrapper and DLL's) and embed it inside a Windows Form, the behaviour of OCX changes. Now, when I press the e I get a +. Basically, any of the Latin-2 characters get corrupted.

We have looked at the WM_KEYDOWN and WM_CHAR events and from what we can see, the key-code is correct in the WM_KEYDOWN but when inside a VB.NET wrapper, the WM_CHAR code is wrong, so the TranslateMessage API function is changing the character code to the wrong thing. Outside VB.NET, the WM_CHAR code is correct.

We think that this is because the VB.Net form is Unicode and that it is treating/assuming any embedded controls are Unicode.

What we wish to know is, is there any way to tell VB.NET an embedded COM OCX is multibyte/ANSI? We can see in the Interop API that there are properties to hold the Charset data (ANSI/UNICODE/NONE) but these seem to relate to calling distinct API's and we can't see how to apply these to the Interop OCX DLL either programatically or using a manifest.

Our other approach was to use the WideCharToMultiByte in the OCX but this doesn't appear to work either.

Any advice on how to tell VB.Net the Charset of the Interop OCX would be greatly appreciated!






I am developing a Windows Form application using MS Visual C# 2010 Express and am having trouble with an ActiveX control. To give some background on what I am attempting to do: We have a number of Sony network cameras at remote locations, which we use for customer service, monitoring and security. The cameras stream video over our network and come with built-in webservers such that you can view the video stream in IE via a downloadable ActiveX plug-in provided by Sony. In addition to the cameras, we use VNC clients for remote desktop viewing at various locations.

The goal of my application is to integrate two video feeds per location, as well as VNC client functionality into one Windows Form application. Locations will be selectable via a combobox control. When the user selects a new location, the form will be refreshed to show the video and desktop for that location. The problem I am having right now is with the Sony ActiveX control. I have successfully imported it into the Visual Studio toolbox and added it to my form. If I set the ParamCamAddress property on the control to the IP address of one of our cameras in the Designer (i.e., the IP address is set at start-up / hard-coded) and run the application, the ActiveX control displays the video feed as expected.

The problem is that I need to be able to change that parameter and reload/refresh the control so that the video feed from the new location selected will display. If I do something like this when the combobox event fires, it doesn't work:

private void comboBox1_SelectedIndexChanged(object sender, EventArgs e)
  Location location = _locDict[comboBox1.SelectedItem.ToString()];
  this.axSonySncRz25View1.ParamCamAddress = location.CameraIp;

I know that's too simple, so I looked at the Visual Studio-generated code in Form.Designer.cs. I find this relevant code in the InitializeComponent() method:

this.axSonySncRz25View1 = new AxSonySncRz25ViewLib.AxSonySncRz25View();

this.axSonySncRz25View1.Enabled = true;
this.axSonySncRz25View1.Location = new System.Drawing.Point(0, 0);
this.axSonySncRz25View1.Name = "axSonySncRz25View1";
this.axSonySncRz25View1.OcxState = ((System.Windows.Forms.AxHost.State)(resources.GetObject("axSonySncRz25View1.OcxState")));
this.axSonySncRz25View1.Size = new System.Drawing.Size(880, 600);
this.axSonySncRz25View1.TabIndex = 2;


I don't see where the IP address I specified in the ActiveX control properties in VS Designer is being set, but it works. I've searched through MSDN and online for general information about ActiveX/.NET interoperability, but haven't come up with much regarding how to reload or refresh OCX controls (that I understand). I've also tried using the code above in various arrangements in my Form.cs code, but to no avail. I just don't understand the principles involved here to know what to do. If someone can point me in the right direction or provide some coding advice, I would be very appreciative.



I am receiving the following error message

"Retrieving the COM class factory for component with CLSID {027D61A3-4251-11D0-B7A4-80BBFFC00000} failed due to the following error: 800701e7"

whilst runnignt hsi line of code

ScannerClass sc =newScannerClass();

The scannerClass is contained in a Scanner.ocx file that is a Symbol Driver to support their Barcode Scanners. I have installed this driver via Symbols own install OPOS-00-324.exe downloaded form their website. The CLSID is in the registry and the ocx has been successfully registered.

Has anyone got any ideas what this error could be?


I have a VB 2008 application that uses MSFLXGRD.OCX in a couple of modules.  All works well under Windows XP, but that control will not register under Windows 7.  When I try to use regsvr32 to register the control, it tells me that I need administrative rights, and I am the administrator of the system.  There must be some further security for the registry under Windows 7?

Any guidance or clues would be greatly appreciated.  This application is critical to company operation, and with the impending move from XP to Windows 7, I really need to get this resolved ASAP.



I know that the older mscomm32.ocx had its kill bit set and have a newer version and have been able to register it under Windows 7 but I still cannot get the communications control onto my form(s).  I keep getting the error message that the activex control is not supported. 

I know that I need to migrate away from this control but time does not permit and I need to be able to continue supporting my users as they migrate up to Office 2010 and beyond.

I've been able to get this to work on Access 2007 under XP so is this a Windows or Access problem?

Any ideas will be greatly appreciated.

hi fri i am having active x control and i want to embed this into my web application please tell me how to do this

thanks in advance


Dear All,

I tried to use the MSDATGRD.OCX control in Access 2003 in order to create a data grid to view data. BUT when I drag-drop the control to the form, an error message will appear says "MS Access 2003 does not support this control”!

I got MS Visual Studio 2005 installed into my computer.


Please could anyone help me in this?




This is very puzzling.  My WinForm application has been working fine without any issue.  However, recently, the same application installed from the "Setup/Installer" started throwing SEHException where the application runs without problem through Visual Studio 2008 enviroment... both debug and release.  When I move my mouse over the Media Control section where "play" button is, SEHException is thrown.

Can someone help please?

The exception stack is:

System.Runtime.InteropServices.SEHException: External component has thrown an exception.
   at System.Windows.Forms.UnsafeNativeMethods.CallWindowProc(IntPtr wndProc, IntPtr hWnd, Int32 msg, IntPtr wParam, IntPtr lParam)
   at System.Windows.Forms.NativeWindow.DefWndProc(Message& m)
   at System.Windows.Forms.Control.WmMouseMove(Message& m)
   at System.Windows.Forms.Control.WndProc(Message& m)
   at System.Windows.Forms.AxHost.WndProc(Message& m)
   at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
   at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)


Hi all,


I want to create an simple ocx control which can just show a message box "Hello World". Please guide me steps for creating .ocx control

I am new to this topic.


I need to use a custom OCX control with a Windows Service application.

I have built a Windows Form application test harness to test interoperability with the OCX control. To do that I added the OCX to the Toolbox, dragged it onto the form and used it successfully.

I now want to do the same in the Service application. However when I create and open the project the OCX control has disappeared from the toolbox.

I have read some similar posts from the past and the general response is that there is no need for an OCX control in a Service application because the service has no visible real-setate to use the OCX on. However in this case the OCX does not have any visual components. It is used to expose functionality to communicate with a third party application. The same third party has provided the OCX to allow others to implement certain functionality in their applications.

Is there any way to be able to use this type of OCX in a Service application? If not, is there a work-around?


Bas Groeneveld


Hi all,
Recently I'm  working on VB 6 migration to dot net, and I found the OLE control is not available in VB .Net (well known, optionally we can use Microsoft Web Browser instead).

The scenario is: the OLE control created as MS Visio to display the VSD file. The OLE object will display and the content of it will stretch accordingly (as for the purpose of identifying the coordinate and location says - a layout of a simple circuit design).
The problem statement: I'm able to display the content in MS Web Browser control and Visio Viewer, but then the feature does not able to stretch (horizontally).

Any ideas and suggestions?
Thanks a lot.

P/S: Is it possible to import the OLE control into .Net environment? but the OLE control is intrinsic object in VB 6, to which DLL or OCX should I import in .Net if this is possible? Thanks folks...

One of the most attractive features of iPad is much better viewing experience with a 9.7-inch multitouch screen designed for a wide viewing angle. Reading on iPad seems like reading a handy book. With the assistance of free iBooks app, iPad can well display e-Pub format ebooks download from iBookstore. How about another popular eBook format-PDF? Does iPad support the PDF? Those questions should confuse a group of people.

Just read back the iPad Spec, PDF supported is mentioned in the "Mail attachment support" item. That's to say, you can read PDF file as attachment on iPad. Till now, iPad can't fully support PDF files. You can not directly read PDF on iPad via sync it with iTunes. As ePub format is used and supported by iBooks app, convert PDF to ePub for iBooks and sync the .epub ebooks to iPad is an easy way out.

PDF to iPad Converteris assuredly effective and easy-to handle program, specially designed for iPad users to freely view and read PDF documents on iPad no matter where you go.

Barely two steps enable you to read/view PDF files on iPad.


      Security settings to protect pdf files, low and high encryption level, up to 128 bit encryption to provide high strength protection for your own PDF files.

      If need to join multiple chapters into a whole artile, combine function can realize and create a completed article without any loss.

     Excel to PDF Convertercan insert watermark into the center of the PDF page with plentiful watermark feature settings.

      Custom PDF author, created date, and paper size with Excel to PDF Converter.

      The Converter has multiple panels to set the compression rate of text and image so as to reduce PDF size for quick opening and transferring.

PDF Converter
PDF Creator
Word to PDF Converter
Image to PDF Converter



      Almost all popular image formats are supported to convert to PDF format like JPEG, GIF, BMP, PNG, TIFF, etc.

      It is allowed to convert between different image formats for the Image to PDF Convertercan also output PNG, JPEG, BMP, PCX, TIFF and script PS, EPS.

      Output PDF files are compatible with Adobe Acrobat 9.0.

      Combine all imported pictures into one PDF file with one image in one page.

      Set password to protect converted pdf files from copying, printing, very safe.

      Place stampstring into PDF page to make created PDF file different and unique. You can even adjust the stampstring's font, size, color, style and other parameters.

      It is flexible to compress text object, image quality and image models to reduce PDF size with Image to PDF Converter.

PDF Converter

PDF Creator
Word to PDF Converter
Excel to PDF Converter


<< Previous      Next >>

Microsoft   |   Windows   |   Visual Studio   |   Sharepoint   |   Azure