|
|
Hi everyone,
I created a project in VC++ (Class Library project in visual studio 2005) and I would like to use it in VB .
I defined 2 functions in classlibrary that one of them uses simple data type such as int,bool,.. in input and return value and other one uses data type such as char * .
When I use simple data type ,there is not any problem and I can call the function in vb successfully but when I use another data type such as (char * ,..)I can not call it and even I can not see the function in vb.
My question is about data type conversion between VC++ and VB.
My code is same as below :
//==============================
MyClassLibrary.h
#pragma once
using namespace System;
namespace MyClassLibrary{
public ref class InitCard
{
public :
bool VerifyPin(char *) ; //I can not see this function in VB
bool SetCardAccessKey(int); //I can see and use this function in VB successfully .
};
}
//======================My VB code is same as below :
Imports MyClassLibrary
Dim Jvm_offcard As New MyClassLibrary.InitCard
Jvm_offcard.SetCardAccessKey(2);
//Jvm_offcard.VerifyPin("1234") //there is an error on this line
I would like to know how can I use data type such as (char *,byte array ,string) between VC++ and VB code.
I would appreciate for any help .
Yours sincerely,
Orchid
|
|
|
|
|
You need to use the .NET String type rather than char* in your C++. I've not done any C++/CLI but don't you need to have something like
bool VerifyPin(String ^) ;
Kevin
|
|
|
|
|
Dear Kevin,
Thanks alot for your help ,My problem is solved .
Thank you very very ...much.
yours sincerely ,
Orchid
|
|
|
|
|
Dear Kevin,
I used String ^ instead of char * and it is ok .I have another question, how can I use byte array in VB?
I mean I have a function in VC++ class library that return byte *,do you know how can I use its return value in VB ,because I have a problem same as char * .when I want to call this function in VB I can not see it .
I would appreciate for your reply.
if you have any document,sample code or link about ".Net Byte array type" please inform me.
yours sincerely ,
Orchid.
|
|
|
|
|
Well, the String thing was a lucky guess based on fragments of artciles I've read about C++/CLI. I don't know offhand how to pass a byte array. Presumably you need to find out the syntax for having an array of managed types.
Kevin
|
|
|
|
|
|
Dear Kevin,
Thanks a lot for your help,
The article was very useful for me and with your help my problem is solved completely .I appreciate for your attention and help.
thank you very much.
yours sincerely ,
Orchid.
|
|
|
|
|
Your welcome.
Kevin
|
|
|
|
|
I want to create a simple custom control inherited from textbox. This control can update the textbox value in a timely manner let say every 30 seconds. The value is is obtained from a variable in the form where this control is dropped. example:
A variable XYZ exist in the form. The control when dropped in the form is also named XYZ. At runtime the control XYZ should determin it name and subsequently take the value of variable XYZ and set the textbox.text property equal to it.
|
|
|
|
|
Hi All
Please Help Me
I have use VB 6.0
I want to attached scanner from user interface and save image.
please help me
|
|
|
|
|
You need to buy a control that offers you a TWAIN interface.
|
|
|
|
|
Hi All
I have written a program in vb.net 2005 for generating dynamic reports from SQLserver 2000 , the report generates successfuly but when it goes for printing with a network printer that I specify it programaticaly I get this error :
Erorr in file E:/DOCUMEN~1/admin/LOCAL~1/Temp/temp_4fc557_33455ed_{asd33dh3_dsd}.rpt
:unable to connect : incorrect logon parametrs
The code that I using for printing is :
Dim
m AsNew A4Bill
m.PrintOptions.PrinterName = "\\Arash\Microsoft Office Document Image Writer"
Try
m.PrintToPrinter(1, False, 0, 1)
Catch ex As Exception
message.Text = ex.Message
EndTry
Thanks for your Help
Arash Rajaei
|
|
|
|
|
Hey there was a default field for printing the reports in crystal report viewer. Then why are u trying for generating ur own print method.
Janani
|
|
|
|
|
i have 100 fields in single form but it is not possible to display all fields in a single form so i make 5 forms to display fields " i want to save all the data with a single button " to save the data correctly what should be the correct way 1. using session variable 2. cookies 3. using temporary tables or somthing else....
|
|
|
|
|
All three are valid options. But if you use 3, you will still need session to store some sort of identification so that you know what records belong to what user.
What method will you use will depend on the amount of data you need to store. Because cookies have limited storage capability (don't know the exact value, google for it).
I would choose sessions in almost any case dough...
--------------------------------------------------------
My portfolio & development blog
Q:What does the derived class in C# tell to it's parent?
A:All your base are belong to us!
|
|
|
|
|
hi all,
i am in a situation to Handle maps in VB.NET Application. i have to Display Customer Details from my Data Base by clicking a place in Map(US and India).
I need Help in doing this.
expecting the replies..
thanks in Advance
Durga
|
|
|
|
|
Hi.
Its possible to do ya.
Try to do it.
Janani
|
|
|
|
|
I have a class that uses string builder which produces a email body that is sent out by the system. My problem is that when i receive the email, random "! " characters are inserted into the text. If anyone out there has seen this problem before, let me know.
For additional information, i place a bunch of vbCRLF after every line and still end up with these random "!" and spaces.
Im also aware of projects migrating from IIS 5 to IIS 6 creates this problem. How can i fix it now
|
|
|
|
|
Could someone please help me figure out how to read in code from a text file that will inturn read another text file to find regular expression from a text file.
|
|
|
|
|
|
I have created a text box that I would like to display history in. For instance with Start/Run how it shows like the past 15 entries on the dropdown. Can anybody help?
|
|
|
|
|
where are you struggling?
is a mult-lined textbox?
To add a new line to the text box:
textbox1.text &= "new line" & controlchars.crlf
if i'm not even close, then please explain
|
|
|
|
|
Get the last n values from the registry at load, into an array.
Read the keypress event for the arrow keys, and show the next/prev values from the array.
He was a snowflake, like other "unique" snowflakes, falling down, getting stepped on, and pushed aside to disappear.
|
|
|
|
|
The array contains many elements, some of them have the same value, now I need to count how many bins (value of the same elements) and number of elements of each bins. It's like plotting a histogram for a group of data.
is there a easy way to do it?
Thank you.
|
|
|
|