|
Unfortunately calling non-COM dlls is not that simple. ByVal is not a general rule by any means, many if not even most parameters must be passed ByRef. Also, you have to translate some C/C++ types into VB-friendly data types. Many types commonly used in C/C++ can be translated into VB types but not all. There is no guarantee that you can call all functions exposed by a non-COM DLL. Writing proper Declare statements is part experience, part trial and error. Save your work frequently - improperly declared DLL calls can often cause your application to crash.
There are rules that Windows uses to locate DLLs. Generally if you put the DLL in either the application folder or the WinSys folder, it will be found.
Robert
|
|
|
|
|
Hi Robert,
Thank you for your reply. I tried putting the dll in question into the application folder (I assume this is the folder in which the vb project resides in?) - Unfortunately again it says that the dll could not be found.
Now when you say WinSys folder do you mean the system/system32 folder in the windows directory? I tried putting them in both folders but unfortunately again no go - File not found: Run time error 53
Any other thoughts?
|
|
|
|
|
Post the exact name of your DLL, and an example of your declare statement in VB and I will look at it. If you wish you can e-mail me the DLL itself too - rwest_graham@yahoo.com
Robert
|
|
|
|
|
Hi Robert,
Thanks for your help but I actually worked it out. It couldnt find the dll cause the system path did not have the dir to the dll location at all. I put it in and it worked like a treat.
By system path I mean if you go into the properties of my computer and then onto environment variables you can specify the path where dll's are stored and if you do this it works.
Once again I thank you and all who posted for your help. Great help -> Great Forum
Nic
|
|
|
|
|
I am not been able to remove items from the collection
a.Add("s")
a.Add("s")
a.Add("s")
a.Add("s")
a.Add("s")
a.Add("s")
For inti As Integer = 1 To a.Count
a.Remove(inti)
Next
when inti=4 then it gives the error
"collection index must be in the range of 1 to the size of the collection"
why is this happening and how to clear collection. Urgent!!!!!
|
|
|
|
|
When you remove an item from a collection, everything above that index number moves down one. So, in your example, when you removed index 1, the items at 2 and above moved down.
Instead of removing every index, count them and remove the first one every time:
a.Add("s")
a.Add("s")
a.Add("s")
a.Add("s")
a.Add("s")
a.Add("s")
For i As Integer = 1 To a.Count
a.Remove(0)
Next
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
|
The easiest way to clear a collection is to put a.Clear(). You should always hit the dot and look through the intellisense if you're not sure if a method is supported. Assuming you were actually stepping through trying to remove specific items, step backwards like this ( sorry C# code, I dunno the VB syntax ):
for(int i = a.Count-1;i>=0;--i)
{
if (a[i] == "ThevalueIwanttoREmove")
{
a.RemoveAt(i);
}
}
That way, the indexes that change are all in the range I've already stepped through.
Note also that your loop cannot work, arrays are 0 indexed, not 1 indexed. a(0) is the first element, a(1) is the second.
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
Christian Graus wrote:
sorry C# code, I dunno the VB syntax
you mean this ?
For i As Integer To a.Count - 1 Step -1
If a(i) = "TheValueIwantToRemove" Then
a.RemoveAt(i)
End If
End For
another much apreciated VB code would be :
For each Ob As Abject In a
a.Remove(Ob)
End For
or even better :
a.clear()
TOXCCT >>> GEII power [toxcct][VisualCalc]
|
|
|
|
|
toxcct wrote:
you mean this ?
Yeah - the step was the part I was not sure of, and I'd prefer to say so than give code that turns out to be syntactically wrong.
toxcct wrote:
a.clear()
Yeah, I did actually point that out as well
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
Hi 2 all
Actually i am developing an Online application, in which I have different users with different user names. Now when they sign in there is no problem to me, but the main problem is that I want to know what would be the code behind the sign out button.
Thanx in advance for helping me.
Bye
Arfan Qadir
|
|
|
|
|
What is the code for signing in?
When sign in, status=1
when sign out, status=0
<italic>Work hard, Work effectively.
|
|
|
|
|
status variable is used for what?
Please try to help me. Please give the idea who i must sign out, so that nobody without login must access that page where i can go only by using my password?
Arfan Qadir
|
|
|
|
|
It's impossible fo us to tell you anything about how to do this because we know nothing of how your authenticating these people and tracking their login/logout.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
can anyone suggest a good and great email component for .net...
currently im using active up trial version...
i can't view the attachments and embedded objects...
please help me... tnx...
|
|
|
|
|
I'm doing my thesis now, I try to make a "Remote Client's Activity with VB" but I have some trouble and I hope anyone can help me, please give me an example of VB program to CONTROL MY CLIENT'S DESKTOP. Thanks for the help.
Help Me Please, I need It Quickly
|
|
|
|
|
Why do you need to do it in VB ?
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
Hi, I am trying to do the same thing for a local school. I am searching for information now and have a call in to Microsoft. If I find out anything I will let you know. If you find out anything, please let me know.
Thanks
Doug Davis
ddavis@xenotg.net
|
|
|
|
|
Hi all i want a small help in changing the exe icon of the program after i run it
i was writing all my programs with visual c++ 6 and .net and i was able to change the icon of the exe file which is generated after compiling the porgram
i want to know how to make it in the visual basic .net
hope anyone could help me
thanks in advance
byebye for now
Gego
|
|
|
|
|
The Form properties has an "Icon" property that you can use to specify a file with an icon image. You can also compile an image if you use ImageList object which is available from the Toolbar. Following is an example to get image at index 0 from imagelist and set it as an icon:
<br />
Dim bm as Bitmap = New Bitmap(myImageListObject.Images(0))<br />
Me.Icon = Icon.FromHandle(bm.GetHicon())<br />
|
|
|
|
|
in VB .NET, display the properties of your projet (or the project that is the start project if you have many projects within the same solution) and click on the 2nd list item...
TOXCCT >>> GEII power [toxcct][VisualCalc]
|
|
|
|
|
Thanks for reply me
but i am afraid i got nothing first i want to clarify what i want to do
after compiling the project it produce an exe file to run it alone the icon of the file is the normal icon which appear after compiling any project i wanna to change this icon as i wanna
hope any one help me
byebye and thanks in advance
Gego
|
|
|
|
|
i m developing a media on demand system, which is an ASP.NET Web Application..
1) how to use login n logout in a multiuser environment ? i think we need to implement cookies, but dunno how to use them.. ?
2) in our web application, the client can play media(audio/video) files on his web page. on the server side, i ve embedded the windows media player on the VB.NET interface... and passing the URL of the media files dynamically to the windows media player...
but if the client has Download Accelerator Plus, when he selects the file to play, the DAP(Download Accelerator Plus) pops up and start downloading these media files... how to disable this DAP from downloading the files on the client's system ?
please help me... i need it badly
|
|
|
|
|
1) Your questions belong in the ASP.NET Forum since your working on an ASP.NET application. It don't matter what language you're writing it in.
2) If the client has this, you can't do anything about it! ASP.NET is a server-side only technology that generates HTML pages for a browser. If there was some JavaScript way of doing it, great!, I have no idea what it is, or if it's even possible.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
as per your two points...
1. I suggest you to use session variables as cookies could be disabled by the client side and in that case your application will not work. So worry about sessions. not for cookies..
2. As far the download accelarator is concerned it is its default behaviour to accept all in coming files other then related to web like htm,asp,jpg etc . I am not sure that you would be able to find any solution for this...I suggest you to use real player as it supports streaming and this might help you...
best of luck
|
|
|
|