473,804 Members | 3,399 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Creating an object visible to Visual Basic

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(arr ay1,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.
Nov 14 '05 #1
3 1842

"rgb" <rb******@i1.ne t> wrote
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.
Nov 14 '05 #2
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

rb******@i1.net (rgb) wrote in message news:<3d******* *************** ****@posting.go ogle.com>...
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(arr ay1,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.

Nov 14 '05 #3


rgb wrote:
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(arr ay1,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.
Nov 14 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
22950
by: smeagol | last post by:
Hi, is possible to create an OCX with .NET? I need to use a control (user control) in Visual Fox Pro, but the old fox doesn't accept usercontrols. Any help are welcome
12
4171
by: enak | last post by:
I have found some code that shows how to convert an html form to Word. The message said to simply put the following in the Page_load: Response.ContentType = "application/ms-word" Response.AddHeader("content-disposition", "inline; filename=BP_CaseStatus.doc") Now all I should have to do is create the page just like I would if I were going to display it in the browser.
2
2016
by: DaWoE | last post by:
Hi all, I'm fairly new to ASP.NET. What i want to do is creat a online registration form. On the first step is getting the users details and the number of people he wants to register. Based on the number of people i want to create a form where he can enter the persons details. For example he wants to register 3 people. Then the second step of the registration would have to be like this :
9
2574
by: Gordon | last post by:
Hello again, Sorry to repost this request, but I'm under a bit of pressure to find a quick solution. All I basically want is an automatically updating link (OLE, not DDE) between a control in my application and a cell in an Excel spreadsheet. My control has to automatically receive updates from the spreadsheet cell. I already know how to access the spreadsheet via the Excel.Application class
1
1333
by: Geraldine Hobley | last post by:
Hello I wish to create an Access Object of an already existing Access .mdb database. Below is how this is done in visual basic 6. Please tell me how to do this in visual basic.net. Dim objAccess As Object Dim strDbPath as string = "C:\MyAccessdb.mdb" Set objAccess = GetObject(strDbPath, "Access.Application")
3
4662
by: tigrrgrr42 | last post by:
I am working(vb.net03and05) with word documents stored in a sql db and I am currently bringing them from a byte array into a temp file to pop into word and make word do its thing as a com object. Is it possible to go straight from a byte array to document in word instead of a temp file? Also is there a way to change the save behaviour to notify my app to pickup a binary copy of the file or stream to save back to the sql db. Thanks in...
1
5467
by: veronique.brenda | last post by:
Hi, I have a macro on Ms Access 2000 with an action: SetValue; Item: !. and Expression:Yes. I have an OpenForm action just before this action, so definitely the form is opened when the SetValue action is called, but I get the following error :"The object you referenced in the Visual Basic procedure as an OLE object isn't an OLE object."
2
4839
by: terry guthrie | last post by:
I need some help with visual basic code, I need to create a timer that will be visible while playing a game, i know there is a timer in the tools that you pull over to the project and is hidden, and then i create a label on the page itself, the purpose is to show in seconds how long it takes to complete a game. what is the code that will link the timer with label so when i start my game you can see how many seconds it is taking.
275
12428
by: Astley Le Jasper | last post by:
Sorry for the numpty question ... How do you find the reference name of an object? So if i have this bob = modulename.objectname() how do i find that the name is 'bob'
0
10567
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
10310
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
1
7613
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6847
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5515
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5647
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4291
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3809
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2983
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.