|
how to call add(int i,int j) function in a mfc dll from vb application.
I have done all the steps to include c++ MFC dll to vb project.
It is working fine with function calls with no arguments like show();
But it returning garbage value when i call add(5,4) which passes arguments to the function.
my code in vb is like this:
Private Declare Function AddValues Lib "dllmfc.dll" (i,j) As Integer
Private Sub btnadd_Click()
Dim ans As Integer
a = AddValues(5, 4)
MsgBox (a)
End Sub
please tell me where i am wrong.
punit singh
|
|
|
|
|
Does integer mean the same thing in C++ MFC as it does in VB.NET? It may be that you are passing or receiving the incorrect type.
CleaKO
"I think you'll be okay here, they have a thin candy shell. 'Surprised you didn't know that." - Tommy Boy "Fill it up again! Fill it up again! Once it hits your lips, it's so good!" - Frank the Tank (Old School)
|
|
|
|
|
the vb code that when inserting a cd,automatically we read all files names.
|
|
|
|
|
is it a question? or you need a solution...
What a curious mind needs to discover knowledge is noting else than a pin-hole.
|
|
|
|
|
Do you mean something like this?
Dim Drive As String = "D:\"
If My.Computer.FileSystem.GetDriveInfo(Drive).IsReady = True Then
For Each File As String In My.Computer.FileSystem.GetFiles(Drive, FileIO.SearchOption.SearchAllSubDirectories)
ListBox1.Items.Add(File)
Next
End If
Trinity: Neo... nobody has ever done this before.
Neo: That's why it's going to work.
|
|
|
|
|
Hi all,
I have a string (for example itcontains "abcde"). I'd like to fill it with spaces until a determined length (for ex. 10) so the final string would be "abcde "
How can I do it?
Thanks in advance,
Marc Soleda
... she said you are the perfect stranger she said baby let's keep it like this... Dire Straits
|
|
|
|
|
Marc Soleda wrote: final string would be
Dim StrLength as Int32 = 10
Dim myString = "abcde"
Dim addSpace as Int32 = 10 - myString.length
Dim I as Int32
For I = 1 to addspace
mystring = mystring + " "
next
What a curious mind needs to discover knowledge is noting else than a pin-hole.
|
|
|
|
|
sorry, I missed to tell that I'm looking for a Framework function . For example: I've done the same but filling it with "0" with the "Format" method but with spaces I can't do it. Is there something similar with spaces?
Marc
... she said you are the perfect stranger she said baby let's keep it like this... Dire Straits
|
|
|
|
|
Format() is a VB6 function and for the padding function there is now a .PadLeft and a .PadRight() .
CleaKO
"I think you'll be okay here, they have a thin candy shell. 'Surprised you didn't know that." - Tommy Boy "Fill it up again! Fill it up again! Once it hits your lips, it's so good!" - Frank the Tank (Old School)
|
|
|
|
|
strABCDE.PadRight(10) That will take into account the length that already exists and then add the number of spaces or characters in order to finish filling to the required length.
CleaKO
"I think you'll be okay here, they have a thin candy shell. 'Surprised you didn't know that." - Tommy Boy "Fill it up again! Fill it up again! Once it hits your lips, it's so good!" - Frank the Tank (Old School)
|
|
|
|
|
Great !! That's exactly what I was looking for.
thanks,
Marc.
... she said you are the perfect stranger she said baby let's keep it like this... Dire Straits
|
|
|
|
|
How do i make an XMLNode a serializable object? do i need to use a wrapper class of some sort?
|
|
|
|
|
XML is serializable by nature, what do you mean?
CleaKO
"I think you'll be okay here, they have a thin candy shell. 'Surprised you didn't know that." - Tommy Boy "Fill it up again! Fill it up again! Once it hits your lips, it's so good!" - Frank the Tank (Old School)
|
|
|
|
|
Im trying to serialize this class (as shown below) but im getting an error
"The type System.Xml.XmlNode is not marked as serialzable". How do i solve this problem?
<serializable()> _
Public Class Alert
Private mNotificationServer As String
Private mNewHour As Xml.XmlNode
.
.
.
End Class
|
|
|
|
|
Can any one out there help me make a web explorer, if you want to / can help THANKS! , if you dont want to dw Im working in VB
-- Zero --
|
|
|
|
|
There is a web browser under common controls in toolbox. You can use it. You should define imports system.web on top of your application.
What a curious mind needs to discover knowledge is noting else than a pin-hole.
|
|
|
|
|
If you need a place to start, you can look here.
Trinity: Neo... nobody has ever done this before.
Neo: That's why it's going to work.
|
|
|
|
|
im stuck on how you make the web broser to work with the progress bar so it tells you how far it has loaded 
|
|
|
|
|
It's really simple:
Private Sub WebBrowser1_ProgressChanged(ByVal sender As Object, ByVal e As System.Windows.Forms.WebBrowserProgressChangedEventArgs) Handles WebBrowser1.ProgressChanged
ProgressBar1.Maximum = e.MaximumProgress
ProgressBar1.Value = e.CurrentProgress
End Sub
Just make sure that you Import System.Web into your project.
Trinity: Neo... nobody has ever done this before.
Neo: That's why it's going to work.
|
|
|
|
|
Why would you want to reinvent the wheel?
Steve Jowett
-------------------------
Sometimes a man who deserves to be looked down upon because he is a fool, is only despised only because he is an 'I.T. Consultant'
|
|
|
|
|
I'dont know the way how to get information from the system sensors.I'll need information about CPU,HDD and motherboard temperature,I want to know voltage in the different parts of my system and in the end I want to see my fan's RPM.I want to know any ways get this information instead if WMI functions, because WMI doesn't work on different computers.Please help ME !!!
|
|
|
|
|
Hi All
I Create A form Named ChildForm.
In Main form I write This Codes
Dim ChFrm As New ChildForm
ChFrm.Show
But I need to access the all form ( random) from Main Form. But I Can't Access This Forms.
Please Help Me.
Tanks.
Mogtabam
|
|
|
|
|
create an MDI Form as your main form.
make all other form's IsMDIChild property to true.
now you can access all the form from your main form.
Live life to the fullest
|
|
|
|
|
Hi And Tanks For Your Replys.
But My Problem Not Solved Yet.
Because I Want To Access then form and its Components (for example A textbox).
I Need To Change It From Main Form.
if i have 1 form This is Ok. But I have several form With One Name;
For Example Can You Write For Me A Code That Change The TextBox In First MdiChild & Put Another Text In Another MdiChilform?
Example:
ChForm:My Child Form
Have a textbox
MainForm: My Main Form
have a button Named But
In Main form:
sub But_click()
dim Cf as new ChForm
Cf.show
end sub
After Tow Or More Click On But I Need To Access TextBox In the ChildForm.
Can You Help Me?
Tanks.
Mogtabam
|
|
|
|
|
Declare the form outside the method (in the global area of the main form, and then create the new form in the button handler. The then the new form object will be available globally within the main form:
Public Class MainForm As Form
Public Cf as ChForm
sub But_click()
Cf = new ChForm
Cf.show
end sub
End Class
However, keep in mind that what you want to do (directly access a control on one form from another) is really bad practice. You should be building properties on the other forms and using them to access the data provided in controls on the form as shown bellow:
Public Class MainForm As Form
Public Cf as ChForm
Private mNameData As String
sub But_click()
Cf = new ChForm
Cf.show
mNameData - Cf.NameData()
end sub
End Class
Public Class ChForm As Form
Public Property NameData() As String
Get
Return txtName.Text
End Get
Set (value as String)
txtName.Text = value
End Set
End Property
End Class
This keeps things much cleaner and more modular.
|
|
|
|