Creating an object visible to Visual Basic

R

rgb

I've got Visual Studio 6.0 and I'm working on a Visual Basic applicaiton.
There a couple parts that really require C.
I've done C programming on a mainframe but nothing on a PC.
So I'm trying to find an example of how to write a function that
has object visibility in VB.

The functionality I want to implement is quite straightforward.
VB will pass me 2 huge byte arrays and about 10 numerical values
that 'tell me how to proceed'. I'll then make substantial changes
to the the arrays and return. Only the array contents need change
not the size.

It would be nice if I could write the C stuff such that VB could do
dim foo as new foo_obj
foo.valA = bla
foo.valN = Xbla
foo.process(array1,array2)
And I could provided a function that VB could call to update a progress bar.
But I'll settle for much less than all that.

Anyone know where an explaination/example can be found?
I've done a little C++ too so if it's easier in C++ no problem.
 
M

Malcolm

rgb said:
I've got Visual Studio 6.0 and I'm working on a Visual Basic
applicaiton.
There a couple parts that really require C.
I've done C programming on a mainframe but nothing on a PC.
So I'm trying to find an example of how to write a function that
has object visibility in VB.

The functionality I want to implement is quite straightforward.
VB will pass me 2 huge byte arrays and about 10 numerical values
that 'tell me how to proceed'. I'll then make substantial changes
to the the arrays and return. Only the array contents need change
not the size.
It is better to ask these sorts of questions in the caller's rather than the
callee's language.

A C function will compile to an object or library file that contains the C
name of the function, or "label" as its entry point. Parameters are set up
in a standard way.

If VB allows you to call assembler functions, the procedure for calling C
functions is likely to be extremely similar.
 
S

s.subbarayan

Hi,
I have done this type of programming before.There are two
approaches:Make a component mainly an ATL COM type of component which
will remove ur language dependency or create a DLL in C and VB allows
u to add dlls in ur code and create objects out of it and u can access
all the dlls functionalities via the created object.Hope this helps.
Regards,
s.subbarayan
 
N

Neil Kurzman

rgb said:
I've got Visual Studio 6.0 and I'm working on a Visual Basic applicaiton.
There a couple parts that really require C.
I've done C programming on a mainframe but nothing on a PC.
So I'm trying to find an example of how to write a function that
has object visibility in VB.

The functionality I want to implement is quite straightforward.
VB will pass me 2 huge byte arrays and about 10 numerical values
that 'tell me how to proceed'. I'll then make substantial changes
to the the arrays and return. Only the array contents need change
not the size.

It would be nice if I could write the C stuff such that VB could do
dim foo as new foo_obj
foo.valA = bla
foo.valN = Xbla
foo.process(array1,array2)
And I could provided a function that VB could call to update a progress bar.
But I'll settle for much less than all that.

Anyone know where an explaination/example can be found?
I've done a little C++ too so if it's easier in C++ no problem.

You will either need to make a DLL or an activeX control.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,766
Messages
2,569,569
Members
45,043
Latest member
CannalabsCBDReview

Latest Threads

Top