Quantcast
Channel: VBForums - COM and ActiveX
Viewing all 62 articles
Browse latest View live

Plz help w/code: "ActiveX component can't create object . . ."

$
0
0
Hello,

I'm having trouble with the following code, I think the issue may be due to x86 vs x64 DLLs*? I searched online but I didn't find info (that I realized) that was helpful. Any help would be very welcome :) :wave::thumb:

*[error code 800A01AD]
Quote:

ActiveX component can't create object" 'Toolsack.Socket'

Code:

'Make torsock out socket name
set torsck = CreateObject("Toolsack.Socket")

'Connect to Tor's control port
torsck.Connect "localhost", 9051

'Auth so we can send commands
torsck.Write "AUTHENTICATE" & vbcrlf

'Read the buffer so we know what to do
chktxt = torsck.ReadLine

if (chktxt = "250 OK") then
  'If we get an OK then send the reload signal
  torsck.Write "SIGNAL NEWNYM" & vbcrlf
else
  'Other wise goto a failed message box
  call failed
end if

'Again read the buffer
chktxt = torsck.ReadLine

if (chktxt = "250 OK") then
  'If we get an OK then Tor reloaded its config
  msgbox "All subseqent connetions will appear to be"&_
"different than your old connections. This means the"&_
"subseqent Tor route (circuit) will use a differnet"&_
"Exit node and therefore a different IP address."
else
  'Other wise goto failed message box
  call failed2
end if

'Everything went good so finish the connection
call finish

sub failed
  'Message box for failed auth
  msgbox "Failed to authenticate."
  call finish
end sub

sub failed2
  'Message box for failed reload signal
  msgbox "Failed to send reload signal."
  call finish
end sub

sub finish
  'Send a QUIT command to Tor and close the connection
  torsck.Write "QUIT" & vbcrlf

  'Again read the buffer
  chktxt = torsck.ReadLine

  if (chktxt = "250 closing connection") then
    'Do nothing because the Tor closed the connection for us
  else
    'Something happen when trying to clsoe the connection so close it anyway
    torsck.Close
  end if
end sub


Need script to extract text at certain places in a set of .txt files... (regEx) ?

$
0
0
I need a small script that uses regular expressions (egrep) or something similar to extract small pieces of information from .txt files, and put this info in a new comma separated .txt. Like this:

1. User put into script the number of iterations to loop (into the code). From A to B. The iterations is the same as the number of files to process.

2. In a set directory, the .txt files have prefixes [001_, 002_ etc]. Script loads the first file.

3. Script checks the FIRST row for a match of [ N], and extract the part between the “ ” before “N” and the previous “ ” on that row. (Example: 00 4430.7486 N 06417.4951 W). If no match, then script instead check on that FIRST row a match of [,”N”] and extract the part between the “,” before “N” and the previous “,” on that row. (Example: 0,4430.7483,"N",6417.4969,"W")

4. Script checks the FIRST row for a match of [ W], and extract the part between the “ ” before “W” and the previous “ ” on that row. (Example: 00 4430.7486 N 06417.4951 W). If no match, then script instead check on that FIRST row a match of [,”W”] and extract the part between the “,” before “W” and the previous “,” on that row. (Example: 0,4430.7483,"N",6417.4969,"W")

5. Script does the same thing as on 3 above, but for the LAST row in the current .txt file.

6. Script does the same thing as on 4 above, but for the LAST row in the current .txt file.

7. Script creates a new .txt file with: loop iteration number, Extraction in 3, Exctraction in 4, Extraction in 5, Extraction in 6. (Example: 001, 4413.7896, 6413.7896, 4412.1256, 6415.2223)

8. Script starts over with next iteration in loop, loads a new .txt file and write a new row in the created .txt file for each round.

Could someone help me with this ? It for a hobby project.

How to handle events from late-bound objects?

$
0
0
Dear friends,
My application already automates Word, Excel and Outlook.
Since its users can have Office 2007 to 2013 in their machines, i decided to stick with late binding to avoid compatibility and installation issues about the Interop interfaces.
It works ok, but I would make great improvements if I could handle the events raised by those applications' objects.
The question is? Can I catch events raised by late-bound objects? If so, how?
Thank you very much for your attention and help.

ActiveX component Cannot create object of type ****.vbs

$
0
0
Hi,

I am facing issue to run vbscript that create the object "CreateObject("Scripting.FileSystemObject")"
when i run the script through the HTML frontend i am getting error as followed
"Activex Component cannot create the object of ***.vbs". I tried many things like reregistering the .dll and .exe that has not fixed the issue.
Can anyone help me regarding this.
Attached Images
 

errors . com after compiling to .rar

$
0
0
wel here is the situation after decompiling my program wich i compiled in a .rar to move to my school server (i can only move 1 file at a time so i had to archive it) i have a couple of errorqs i do not understand wich block me from opening my designer the errors are

-Warning 1 Cannot find wrapper assembly for type library "DAO". Verify that (1) the COM component is registered correctly and (2) your target platform is the same as the bitness of the COM component. For example, if the COM component is 32-bit, your target platform must not be 64-bit. GIP

-Warning 2 Cannot find wrapper assembly for type library "Microsoft.Office.Core". Verify that (1) the COM component is registered correctly and (2) your target platform is the same as the bitness of the COM component. For example, if the COM component is 32-bit, your target platform must not be 64-bit. GIP

-Message 3 Could not resolve mscorlib for target framework '.NETFramework,Version=v4.0,Profile=Client'. This can happen if the target framework is not installed or if the framework moniker is incorrectly formatted. 0 0

-Warning 4 The referenced component 'DAO' could not be found. GIP

-Warning 5 The referenced component 'Microsoft.Office.Core' could not be found. GIP

if oyu know how to help me or i need to provide more info opls comment thank you in advance

How do I embed activex control in html?

$
0
0
Ok, I made a simple HelloWorld type control in VB6, and just left it with the default name Project1.ocx. I would like to know how to embed my control in a webpage. Does the OCX file have to be in the same folder as my index.html file? Do I have to install it on the server computer? Does the person browsing the web and wanting to use it need to download a copy and install it on their client computer? Can it run straight from the OCX file without being installed (normally it can't when using an OCX in another program in VB6, but is the way the internet handles it different than the way an EXE handles it)?

Upgrading VB6 project that has many custom ActiveX controls

$
0
0
Hello
I work in a scientific research lab, which is in the process of upgrading its control software from vb6 to vb.net. The software has a lot of custom ActiveX controls, written either by manufacturers or ourselves to control the equipment in the lab. The software consists of many modules, all implemented in the same fashion: (1) an interface that has only function definitions (like the header file in C), (2) different implementations of the interface, and (3) a GUI. The interface is compiled into a dll, the implementations into ActiveX controls, and the GUI is just a VB6 form. My question is: what is the best way to upgrade a project like this?

I just upgraded one VB6 form using the upgrade wizard in VS 2008. The ActiveX control on the form seems to work fine, except when I try to close the form, the program crashes. The error message is that the program referenced memory that could not be “read”. Is there any special thing to do with the ActiveX control before closing the form? Here is the code in the FormClosed() method. "theScan" is a custom ActiveX control on the form.

Private Sub LineScanForm_FormClosed(ByVal sender As Object, ByVal e As System.Windows.Forms.FormClosingEventArgs) Handles Me.FormClosing

If (theScan.isScanRunning) Then
Call theScan.stopScan()
End If

End sub

Thanks so much for your help.

Create ActiveX DLL for Crystal Reports UDL Function that will insert row in DB table

$
0
0
Hello!

I got a new project on my desk and have no idea how to accomplish it.
I am working with SQL Server 2012 and Crystal Reports 11.
I have a report that is being emailed through an automated email application (Reportal) to the Ink Department.
The email contains a list of job numbers and job description for all jobs in process that need ink mixed.
The Operations Manager is upset because it takes a long time for the ink matcher to clock in each job number and say ink mix is done.
He wants me to add a button or hyperlink to each line of the report and somehow pass the job number for each row to some function that would clock the ink matcher into the job.

From reading online it appears I need to create a DLL - ActiveX which can be copied into the Crystal Report folder and used as a user function in the Crystal Report.

I want to pass the jobnumber field to this function.

How do you create a function that inserts a row in the database?

I know SQL, so I know how to write the insert into table code but I don't know how to create a function in COM and export it as a DLL file.

I have 0 experience in Visual Basic.

Can anyone help me with this?

Thank you!

How to Get my COM dll to be able to be used from Excel VBA code

$
0
0
I have been programming in VBA for a while now but not much in VB itself.

I want to create a COM dll with parts of the code that I currently have in the Excel VBA and have these functions accessible to be called from the VBA codes itself.
the code in the dll will be mostly calculations of data and this is meant for ease of maintenance and installation as well as protecting the IP of this code.

I created a DLL using "Microsoft Visual Basic 2008 express edition".

I can't get the DLL registered in windows and I can't call it directly from VBA so I am stuck.

when registering I get the following error: "The module ..... was loaded but the entry-point DllRegisterServer was not found"

COMRemoting(Client Side)(Server Side)RemotingCOM E_NOINTERFACE

$
0
0
So, here it is. Basically, I have a VB5 client/server app that communicates via DCOM. Because of the horrendous times we have been having keeping it working, I have finally decided it was time to start phasing the DCOM out. The very first step to do this needs to be to create a .NET Remoting/WCF bridge between the client and server.

I have linked the server.com to the server.Remote and the client.remote is able to communicate with with com objects passed through the Remoting bridge. The problem lies in exposing the class that obtains the server.com objects back to the COM client. The same code that works within the Client.Remoting is unable to pass the same object one step further to the client.com when client.com asks for it. The error is E_NOINTERFACE. I am at a complete loss as why this is. Other methods on client.Remoting exposed over the same COM interface do work. So it seems somehow that an interface required to connect the object from server.com between client.Remoting and client.com is either broken or missing. The interface is in the references for all projects passing it along the way. And as indicated, it appears that the variables and methods are making it at least as far as the client.Remoting from the server.com.

I have also tried passing a variable bored through a function call to get the data all the way through with the same result. I have thought about trying to do a delegate/callback/addressof type thing to see if I can just pass back a pointer to it but I really don't like that idea.

I'm wondering if there is a marshalling issue or if I'm missing a reference or need to manually define an interface. I'm hoping someone can give me a better direction to go in.

I'm hoping this will make sense to someone before I paste any code in.

Client/Server VB5
Server COM EXE
Vb.NET Express 2013

[RESOLVED] Accessing OCX Component wrapped within another ocx

$
0
0
this one is confusing me.

I have an editor component which is wrapped within an ocx. (scivb)
I have a debugger control which is wrapped in an ocx and uses the scivb editor (dukdbg)

Now I am embedding the the dukdbg debugger control in my host form.

I would like full access to the underlying scivb editor component. I know I cant share it directly by name unless they were both in the same ocx library (Can not share private object type as a public return type yada yada)

I should be able to share it as an generic object type though like

Code:

'dukdbg usercontrol
property get sci() as object
    set sci = scivb
end property

and then in the host form: (after adding a reference to the same scivb ocx)
Code:

dim sci as SciSimple
set sci = dukdbg.sci

I have tested this general mechanism with other activex controls (even vb created ones)
and it works.

but every time I try it with this one scivb editor control it fails with a type mismatch.

I have checked the vbp files to make sure the GUID and version are exactly the same..they are.

The best I seem to be able to do here is to just keep it as object and then use late bound calls which works...but I really want the intellisense :(

has anyone run into this screwy behavior before?

[RESOLVED] Lyrics Plug-In for WMP

$
0
0
I have downloaded the Lyrics Plug-In for Windows Media Player. would like to know if there is a way to sed the lyrics data to a RichTextBox. If so, any direction in this area would be appreciated.

OPC server(or DDE server) data reading

$
0
0
Greetings,

I`m using analog signal PC data logger with special software for data collecting/analysis and in this software is available OPC(or DDE) support for recording external data.

In the software for OPC server first channel ONLINE path looks like this:

\\my_pc\\TEST.ONLINE.C_1


...or for DDE server first channel ONLINE path look like this:

\\my_pc\EVDDESERVER|TEST!ONLINE.C_1

(DDE server channel reading value is possible to display in the EXCEL cell and it looks like this "=EVDDESERVER|TEST!ONLINE.C_1")


And the question is: how to make in VB form textboxes to display/read/show this signal ONLINE value from OPC server(or DDE server)?

Thanks in advance.

Problem with MSComm port

$
0
0
hi, im new with MSComm. I try to connect the com port with VB6.0. the problem i got is the vb say Invalid port number(8002). i already check the port number at Device manager any try connect any port available but still same. anybody know how to overcome my problem??

thank you

Name:  Captureefwef.jpg
Views: 104
Size:  45.1 KB

code that im using >>>
Quote:


Private Sub Form_Load()
MSComm1.RThreshold = 1
MSComm1.InputLen = 1
MSComm1.Settings = "9600,n,8,1"
MSComm1.CommPort = 40
MSComm1.InBufferSize = 16
MSComm1.InputLen = 10
MSComm1.DTREnable = False
MSComm1.PortOpen = True
End Sub

Private Sub Frame1_DragDrop(Source As Control, X As Single, Y As Single)

End Sub

Private Sub MSComm1_OnComm()

End Sub
Attached Images
 

[RESOLVED] VB6 ActiveX DLL - visual styles

$
0
0
Hello,

I'm searching for a Methode to enable visual styles on a dialogs which are created by an ActiveX - DLL.

Microsoft highlight that Visual Styles are not possible for ActiveX DLL's .. once compiled with VB6.
As far i know they mentioned this as well for executables in the beginning but we all know that this is possible.

The project type is ActiveX DLL -> Type=OleDll
Custom controls can use api's to draw theme parts .. but i have found no possibility to enable themes for Common Controls (like a listview)
I tried the CommonControls replacement project from Krol - which is likewise not able to display themed controls.

For testing purpose i changed the project type to ActiveX EXE -> type=OleExe
Yes - Visual Styles work properly .. however with some negative side effects
a) in some cases very slow
b) several logic's require a complete redesign (like clean unload, multi instance handling, "file lock")

I tried the most technique's to init common controls (including resource ID 123 and other techniques for snap-in's msdn) .. but nothing worked.

Splitting into 2 parts (Satelite EXE in order to "handle" the dialog's and the core DLL as add-in) is likewise a solution - however there must be a "one-file" solution.

Maybe you can share your idea's / experiences.
i hope there is a way ..

Thank you

*** update
obviously I totally underestimated the vbRichClient and the widget engine.
I spend some time with the documentation / build some dialogs .. and yes the overhead of ~ 4MB is it worth.
Why the hell I have not looked at this project earlier. (i wasted a lot of time in creating owner drawn user controls and DEP aware subclassing)

DLL (OCX) Hell

$
0
0
I made an OCX and each time I rebuilt the OCX I set the bin compatblity to the previous release. So

1.1
1.2
1.3
1.4
1.5

So any program built to use ocx v0.1 has no problem using any later version.

Or that's what I thought I did. But For whatever reason the chain looks like this:

1.1
1.2 -> 1.3
1.4
1.5

For some reason 1.4 used 1.2 as the bin compatbilty reference so 1.3 is now a branch


So, programs original built to use 1.1 or 1.2 still have no problem using any later version. But any program built against 1.3 will break if any later ocx is installed on that computer.

There really is no difference between the versions - I mean all functions and properties have exactly the same args and return values. Changes were minor inside the functions so if a program built for ocx 1.3 could somehow be forced to use a later ocx it would work just fine..

Now I'm about to make version 1.6 and have just noticed the problem. I intend to change the name of the ocx so that it doesn't need to tag onto the old broken chain.

But is there anything I can do to fix the problem? Somehow patch the chain to bring 1.3 back into the chain so that programs using 1.3 can use later versions of the OCX ?

Sorry if this is long winded and prossibly not explained very well but anyone who regularly makes OCX's will know what I'm talking about.

Thanks
I

SendKeystrokes to inactive window from ActiveX VB script DTS

$
0
0
Hello All
I need to send keystrokes to putty terminal from DTS (ActiveX vb script) , i have used WScript.Shel.SendKeys but the problem is that it is working only on active windows .

I need to send strings to the putty terminal even it is not active
I am using ActiveX Script

Runtime error 429

$
0
0
Hi,

I'm looking for help on a VB application we have running on a Win 7 VM. When selecting a command button to produce a PDF we are receiving a "runtime error 429: activex component cant create object" error.

This is an application we have inherited and unfortunately we are unable to track down the source code. We have so far tried:
Installing a local version of Visual Studio and registering all associated .ocx and .dll files
Tracing through the process with process monitor and recording any error events
Runnig a dependency app against the .exe and re-registering all .ocx and .dll files returned

Are there any hints or tips that this forum can provide that might be able to help us, or any suggested applications that might provide a more extensive trace than the error message (which is just telling us the function where the error occurs)?

Any help would be really appreciated.

Thanks,
James

[RESOLVED] Runtime error 429

$
0
0
Hi,

I'm looking for help on a VB application we have running on a Win 7 VM. When selecting a command button to produce a PDF we are receiving a "runtime error 429: activex component cant create object" error.

This is an application we have inherited and unfortunately we are unable to track down the source code. We have so far tried:
Installing a local version of Visual Studio and registering all associated .ocx and .dll files
Tracing through the process with process monitor and recording any error events
Runnig a dependency app against the .exe and re-registering all .ocx and .dll files returned

Are there any hints or tips that this forum can provide that might be able to help us, or any suggested applications that might provide a more extensive trace than the error message (which is just telling us the function where the error occurs)?

Any help would be really appreciated.

Thanks,
James

converting this to C#

$
0
0
I am new to the COM interface. So i am learning i got success bit in C# side but now i am in confusion

i have to convert this following demo code which is in vb.net to C#

if anyone can explain and help me i will be much much happy i am not good in vb.net please help me

..////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////


...




In the following example a test module is started:

Dim TMStarted, MeasStarted, App, TestModule

TMStarted = False
MeasStarted = False

Set App = CreateObject("CANoe.Application")
Set TestModule = App.Configuration.TestSetup.TestEnvironments.Item(1).Items(1)
Set Meas = App.Measurement

' set up connection to event handlers
WScript.ConnectObject TestModule, "TestModule_"
WScript.ConnectObject Meas, "Meas_"

Meas.Start()
While (Not MeasStarted)
WScript.Sleep(200)
Wend

TestModule.Start()
While (Not TMStarted)
WScript.Sleep(200)
Wend

' Now we can be sure that the test module is started

Sub TestModule_OnStart()
TMStarted = True
End Sub

Sub Meas_OnStart()
MeasStarted = True
End Sub
Viewing all 62 articles
Browse latest View live


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>