Calling C++ DLL From VB?

Sep 1, 2010

I'm not sure whether this is a VB forum question or a C++ question, but I'll try here first. I have an API library written in C++ (including source) which compiles to several DLLs. I want to call the functions in the library from VB but I can't get the parameter passing right.

[Code]...

The above example runs but returns nothing. If I change DeviceName to ByRef, I get protected memory errors.

The full library and documentation is available on the internet if anyone would like to download it and I've successfully compiled it with VS2010.

View 2 Replies


ADVERTISEMENT

Calling .NET Dll From C++?

Aug 3, 2010

I have a C++ application exe that uses a C++ dll. I don't have the source of this C++ application and cannot rebuild it. But I know that it uses the traditional LoadLibrary and GetProcAddress to access individual functions in the dll.For some reasons, I want to replace the C++ dll with a VB.NET dll. The dll is not and ActiveX and is therefore not registered.I think I cannot use a class but a module since the C++ exe application does not expect any class in the dll. In all my attempts, I could not have the inner functions of the VB.NET to be called by the C++ exe.How should I write the VB.NET dll?

View 2 Replies

Calling C++ DLL From .net?

Sep 16, 2011

I do realize that a number of questions regarding calling a DLL from vb.net have been raised. I have implemented the DLL from vb.net. I would like to know if the calling procedure is correct or should I be calling the DLL in a different way?

C++ DLL prototype

extern "C" int FitCurve(int solid_or_fluid, int prop_id, int fit_id, int N_points, int N_terms, char *file, double *x_data, double *y_data)

View 3 Replies

Calling C++ Dll In VB?

Dec 28, 2010

I have a dll which has one function and I want to call this function from Visual Basic 2008. I tried every solution, but I couln't get it to work,

The original declaration is the following in C++

extern "C" CSSM_API void GetOptimalCSSMShaderParams(
float* outProjMatrixArray
,float* outCtrlMatrixArray

[Code].....

View 1 Replies

Calling SAP RFC Using .Net?

Jun 9, 2010

I want to connect to SAP and call RFC from VB.Net 2008.I have done it with VB 6.0 But not getting success in VB.Net I used following code in VB 6.0

Set ctlLogon = CreateObject("SAP.LogonControl.1")
Set oConnection = ctlLogon.NewConnection
oConnection.User = "SIILRFC"

[code].....

View 8 Replies

Calling VB DLL From C++?

Jun 21, 2012

I have followed instructions on Best way to use a VB.NET class library from a C++ DLL? but being new to VB I don't know if I've got the VB part right let alone the C++. here I'll correct the code below for posterity's sake!

Here they are: VB first; the project is a Class Library, all settings default except that "Register for COM interop" is switched on in the project properties.

Public Class Class1
Public Sub New()
'do stuff

[Code]....

is the VB correct? Do I need to add anything like an interface to it? Assuming I want to call it over COM not C++/CLI, how do I do that. (This seems like the logical choice as the client already calls other stuff over COM; however, I'm not sure where to get the IDispatch pointer from, in my other code it's passed to me by the client). If I went the C++/CLI route, when moving up from toy project to actual implementation, that would mean changing my existing C++ code from "no clr support" to "/clr" - is that likely to break it?

View 1 Replies

Calling VB.NET From C++?

Aug 3, 2010

I have a C++ application exe that uses a C++ dll. For some rasons, I want to replace the C++ dll with a VB.NET dll. The dll is not and ActiveX and is therefore not registered.I cannot use a class but a module since the C++ application does not expect any class in the dll. In all my attempts, I could not have the inner functions of the VB.NET to be called by the C++ exe.How should I write the VB.NET dll?

View 4 Replies

.net - Calling A Sub And Returning A Value?

Mar 15, 2012

This might seem like an insanely easy question, but I cant seem to find an answer anywhere to it. I'd like to think that I am decent at VB but while I was learning javascript the other day I found something that seemed awesome and now I cant figure out how to do it in VB.in javascript it looks like this

var someValue = getThatValue()Its both calling and setting the value from the getThatValue() sub. what is the VB equivalent?

[Code]...

View 2 Replies

.net 2.0 - .Net Calling New Without Assigning Value?

Jun 10, 2010

In C# I can do this:new SomeObjectType("abc", 10);

In other words, I can call new without assigning the created instance to any variable. However, in VB.Net it seems I cannot do the same thing.New SomeObjectType("abc", 10) ' syntax error

Is there a way to do this in VB.Net?

View 3 Replies

A Calling Error With SAP And .NET

May 14, 2012

I was using .NET for development an SAP application but recently, it always shows me the message below:

failed to call remote function module

I didn't change any setting or source code. But it still has the problem.

View 1 Replies

C# - Calling Web Service From C++ V6

Nov 17, 2009

i have been deploy webservice in vb.net .

is there will be any problem if i will cal the webservice from c++ (version 6) or Microsoft Access VBA?

View 3 Replies

C# - Run.Cs Or.Vb Files Without Calling The In Asp.net

Oct 13, 2009

By security reason I ask this... Can .cs or .vb files to run in any way without calling those in asp.net?

View 2 Replies

C++ - Tcl Extension Calling A .NET DLL?

Feb 8, 2012

I have a need to create a Tcl extension that calls a managed .NET DLL/Class Library. Currently, the structure of my application is Tcl > DLL Wrapper (C++ CLR) > .NET Class Library (VB.NET), where ">" represents a function call.

My VB.NET DLL just takes a value and returns it back, keeping it simple for now. In the end, this will do some more advanced stuff that makes use of some .NET functionality.

Public Class TestClass
Public Function TestFunction(ByVal param As Integer) As Integer
Return param
End Function
End Class

My Tcl Extension (C++ CLR) creates an object of the type above

int TestCmd(ClientData data, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[])
{
// Check the number of arguments

[code].....

If my VB.NET DLL is in the same directory as my extension DLL, the extension crashes when it instantiates a TestClass object. I've noticed if the VB.NET DLL is relocated to C:Tclin, the extension will find it, and TestCmd can be called just fine. The problem is that this will eventually need to be deployed across a number of PCs, and it's preferred not to mingle my application's files with another application's.

View 2 Replies

Calling 16 Bit Executable On 64 Bit OS?

Jul 20, 2009

Is there any way to execute older 16 bit executables on 64 bit OS?

my code does a lot of runs of old 16 bit .EXEs inherithed from DOS era, but it does not work on 64 bit.

View 8 Replies

Calling A .cmd File?

Feb 21, 2012

The cmd file calls a web service that is used to select specific data. When I run the .cmd file manually (as in clicking on it) it runs correctly an saves the file with the information in the appropriate location. However when i try to do this with the .Net app the file is saved however there is no data in it. Why is it when I physically click this same .cmd file with my mouse it works but not when I call it from my application.

View 1 Replies

Calling A C DLL Function?

Oct 3, 2011

I have used the PInvoke Signature Toolkit to create VB.NET function definitions for three fairly simple C functions contained in an external DLL. The problem is that two of the parameters are structures so pointers need to be sent and one structure (fileview) is undefined.

OpenFileView(filename, &fileview_ptr)
ReadFileInfo(fileview_ptr, &fileinfo_ptr)

The structure of fileinfo is defined so I can create a structure definition in VB.NET and create an IntPtr to that structure with Marshall.AllocHGlobal. And then I can use Marshall.StructureToPtr to copy the data and do the inverse when the data is returned.

[Code]...

View 1 Replies

Calling A C Function From A DLL?

Dec 7, 2009

I'm having some problems calling a C function from a DLL. The function is returning -101 which translates as a "bad parameter". The values I am passing have been returned from another, successful function call, so my current assumption is that I've built the structure incorrectly.The function definition is:

int sm_switch_channel_input(struct sm_switch_channel_parms *switchp)
Parameters
*switchp (a structure of the following type):
typedef struct sm_switch_channel_parms {

[code].....

View 2 Replies

Calling A Different Program All Together?

Jan 8, 2009

i just wanted to calafiy i know how to call a different sub and everything but i wanted to know if you could call a different program all together.

say you have on the first WITCH POWER DO YOU CHOSE. then they hit NEXT and it takes them to a whole new layout and program like saved in a different folder.

i think you do this like you would with webpages

Call ../folder/folder/frmbladeda

if thats wrong or there is an eazyer way also would i do the same thing with varibles like how you do Call addtogether(strone, strtwo) addtogether would be the private sub and strone and strtwo would the the varibles in that said sub.

make sure i want to call a different program like 3 folders away

View 2 Replies

Calling A Function In A DLL?

Mar 18, 2009

in a DLL that takes a pointer to a structure as a parameter.The C and VB code is as follows.Am I passing the structure in calling the DLL correctly? I am asking because the API call returns a valid error code indicating error opening the com port specified. I tried all valid ports (com1 on a Vista 32 machine with a USB-Serial device and com1 defined in device mgr, com1 and com2 on a desktop with winxp and 2 real serial ports).I dont have the code for the DLL and cannot debug into the DLL code.

C code
typedef struct _SETUPPR {
CHAR Port[5];

[code].....

View 1 Replies

Calling A Function Like A Sub?

Mar 15, 2011

I'm sure this is a pretty simple question but I can't seem to find the answer on Google. Say I've got a function that does some stuff and returns a string. I can assign its return value to a variable:

Dim result As String = MyFunction()

But sometimes I want to perform the actions within the function but I don't care about the return value. I know I can simply call the function from code.

Sub Main()
' Code
MyFunction()
' More Code
End Sub

This works and does exactly what I need it to. My question is - are there any issues or pitfalls in doing this? Particularly I want to make sure I'm not introducing any performance or memory leak issues.

View 4 Replies

Calling A Function?

Apr 9, 2010

The function is something like this: "function recieveFindPlayerResponse(displayString)"Now, how can I call it. I was trying this:Call AxShockwaveFlash1.CallFunction("_root.recieveFindPlayerResponse(displayString)")And before I had this, I had a Call function which defines displayString. (Works, as I've tested it before, and no error is given to this.)Now, how can I call a function like the above?

And example of what the code looks like from ******* swf decompiler is:
function recieveFindPlayerResponse(displayString)
{

[code].....

View 4 Replies

Calling A Public Sub ... Nothing Happens?

Jun 21, 2010

Im having trouble with this code, when i had it working with static variables set, it was fine, now i am using a passed variable, its not working... Might not be anything to do with it, anyhow...

[Code]...

View 5 Replies

Calling A Sub From Another Form?

Sep 21, 2010

I have two forms and one needs to call a method from another form. I am from a java background so i do not understand why the object instaniated (if that is a correct assessment) on one form cannot Call a sub from the second form.

View 1 Replies

Calling A Sub On A Form?

Mar 2, 2009

i used the code below to find if any forms called logform are open, there will only ever be one of these open at a time...

Code:

Dim frm As Form
For Each frm In My.Application.OpenForms
If frm.Name = "logform" Then
MsgBox("found form")

[code].....

but thing is when i find the form i want to call a sub in that form's code called action if i use frm.actions() it says that actions() is not a member of [URL]so how do i do this?

View 14 Replies

Calling A Vb Function From Its Name

Mar 17, 2010

in VVB.net I have a string that contains the name of a function, say dim funcstr as string = "MyFunc1". How do I call the function or sub whose name is contained in the string funcstr (in this case, MyFunc1)?

View 9 Replies

Calling C Code From VB?

Oct 19, 2009

I can call C code from Visual Basic by compiling that C code into DLL's.

1. Does it have to built in Microsoft Visual? Or is something built with MinGW okay?

2. How do I add it into my VB project?

3. How do I actually make the function call? (given that VB and C syntax obviously have some differences)

View 5 Replies

Calling Dll But Got Errors

Sep 21, 2011

So I've made an dll file from an .vb file .dll file : Public Class ControlDigits

[Code]...

View 2 Replies

Calling Dll In Python?

Sep 1, 2009

I have a function in vb that is converted to a dll that I want to use in python. However trying to use it, I get an error message this is the VB function

Function DISPLAYNAME(Name)
MsgBox ("Hello " & Name & "!")
End Function

and this is how I call it in python

from ctypes import *
test = windll.TestDLL
print test
print test.DISPLAYNAME("one")

But I get errors so what is the right way of calling the dll

Traceback (most recent call last):
File "C:Test estdll.py", line 4, in <module>
print test.DISPLAYNAME("one")

[code].....

I have been looking around online but no solution so far. Can't use cdll since this is for c progs.

View 3 Replies

Calling Executable Off Of USB

Mar 3, 2011

I am making a program that will be run on a usb drive. The program needs to run exe that are on the drive but do to it being a usb drive from computer to computer the drive letter can change. How would I be able to run the exe,

Example
F:Portable-VirtualBoxPortable-VirtualBox.exe

So I would use
Private
Sub
Button4_Click(ByVal
sender As
System.Object,
ByVal
[Code] .....

No problem but when I put the usb into my other computer drive F is no longer drive f: but drive o:

View 4 Replies

Calling Form By Using As New?

Dec 13, 2009

I am just wondering the difference between using "As New" and not using it. It looks like the outcome is same to me. Is there any difference between #1 and #2 when I call "frmCR" from other winform?

A form "frmCR" is alreadu created thru design mode.
#1
Dim frmCR As New frmCR
frmCR.Show()

#2
frmCR.Show()

View 7 Replies







Copyrights 2005-15 www.BigResource.com, All rights reserved