Skip to content

Visual Basic

Visual Basic Questions

This category can be followed from the open social web via the handle visual-basic@forum.codeproject.com

34.4k Topics 120.1k Posts
  • help Converting the below project in vb.net

    csharp com help question
    7
    0 Votes
    7 Posts
    0 Views
    T
    ...Continuation: '===================== '2) Public Function GetServerType(ByVal ServerName As String) As ServerTypes Dim svrInfoPtr As IntPtr = IntPtr.Zero Dim svrInfo As Win32.SERVER_INFO_101 Dim hResult As Integer = Win32API.NetServerGetInfo(ServerName, 101, svrInfoPtr) 'Make sure the API Declarations have the Appropriate Byval / Byref If (hResult <> 0) Then 'Marshal.PtrToStructure(svrInfoPtr, GetType(svrInfo)) Marshal.PtrToStructure(svrInfoPtr, svrInfo) Return Ctype(svrInfo.dwType, ServerTypes) Else Return ServerTypes.None End If End Function I am sorry if there is anything wrong with these Posts...again, I did this all by looking at it and I did not "Pre-Code" this to see if it works. Good luck! Not all those who are lost are looking to be found. But of those who are lost and those who are found, all are looking for something higher than themselves.
  • Print PDF files from batch files

    question
    2
    0 Votes
    2 Posts
    0 Views
    B
    Here ya go : http://partners.adobe.com/asn/developer/acrosdk/docs/getstart/DeveloperFAQ.pdf#page=32[^] I haven't tested this myself as I don't have a printer attached. Bruce Duncan, CP#9088, CPUA 0xA1EE, Sonork 100.10030 Blackadder: Baldrick, have you no idea what irony is? Baldrick: Yeah, it's like goldy and bronzy only it's made of iron.
  • Random Numbers

    c++ help csharp question
    3
    0 Votes
    3 Posts
    8 Views
    D
    i had a similar problem with vb.net first i had coded the game yahtzee in vb6 and it worked fine then i was converting it into vb.net and after i got all the stuff out of the way i ran it in debug mode and i saw i got 5 random numbers which i use to change the pictures of the die showing but when i took it out of debug mode i get the same five numbers like i get all 1's or all 2's etc but the moment i put it into step by step debug it works perfectly again so maybe its a bug in .net cause i got pretty pissed off because i thought how in the hell do i debug something that works perfect in debug mode? don't know if this helps or not
  • Dont kick me off

    learning csharp html
    4
    0 Votes
    4 Posts
    11 Views
    D
    you could buy either the complete idoits guide to vb or vb6 for dummies but i recommend the idiots guide they are always better
  • 0 Votes
    5 Posts
    0 Views
    O
    Hi, It gives me the same error. Pedro
  • wave files

    csharp help
    1
    0 Votes
    1 Posts
    0 Views
    No one has replied
  • Passing the address of an array to a pointer

    csharp c++ com data-structures
    1
    0 Votes
    1 Posts
    0 Views
    No one has replied
  • Multithreading??

    csharp game-dev question
    2
    0 Votes
    2 Posts
    0 Views
    N
    Haven't you done any courses in Computer Science. I sure threads were one of the subjects covered. Anyways... An Application that is running is usually refered as a process. Within that process, or any process for that matter, are pieces of related codes, or Threads. Thus, a process is made up of one to many pieces of thread. Now, in VB6, multithreading is not supported since your code gets executed step by step. A thread will have to wait for another thread to finish before it can execute. This can lead to your resources being wasted. An example of this is a thread that is writing to disk. When this thread is executing, the CPU is idle when it could be doing something. The concept of multithreading is that the CPU should always be doing something, to fully utilize it. VB.Net allows you to execute more than one thread at the same time, thus fully utilizing your app. For more imformation, try buying a Comp Sci book. I'm sure their explanation is much, much better.;P Notorious SMC The difference between the almost-right word & the right word is a really large matter - it's the difference between the lightning bug and the Lightning Mark Twain Get your facts first, and then you can distort them as much as you please Mark Twain
  • control array in VB.net

    csharp database data-structures help
    2
    0 Votes
    2 Posts
    0 Views
    P
    Hi, Why so many textboxes??? Isn't it a bit hard to with for the end user??? If you open your controlbox window you can find a wrapper for control array's Go to your customize Toolbox window. Then select the tab ".NET Framework Components" Find the component "TextBoxArray" that's the compatibility component for the control array. but why not redesign your application to use less textboxes or assign the same eventhandler to one event and check on the "sender" variable. greets, Poolbeer Speak Out! Use the Source, Luke! (Dr. GUI .NET #5)
  • What am I doing wrong with Public?

    question
    4
    0 Votes
    4 Posts
    1 Views
    D
    David Williams wrote: The Public keyword in the Dim statement declares elements to be accessible from anywhere within the same project That's true if the element is global, but you forgot about how scope works. An element declared within a class is not global, but if declared as public can be accessed outside of the class. In order to do that you must reference the class. For example: You have a global variable declared in your project: Public Var1 As Integer 'Global, accessable anywhere in the program Then you have a class that can use that variable: Public Class TestClass1 Public Var2 As Integer 'Accessable from outside the class Private Var3 As Integer 'Accessable only in the class Public Sub MyProc() Dim Var4 As Integer 'Accessable only in this method Var4 = Var3 'This is OK because Var3 can be accessed anywhere in the class End Sub Private Sub MyProc2() Dim Var5 As Integer 'Accessable only in this method Var5 = Var1 'This is OK because Var1 can be accessed from anywhere. End Sub End Class If you have a global instance of that class: Public TestClassObj as TestClass1 Then you can access public data inside that class: Public Class TestClass2 Private Var6 As Integer Public Sub DoSomething() Var6 = TestClass1Obj.Var2 'This is OK because TestClass2 has indentified where Var2 can be found End Sub End Class So, the VB doc you mentioned was correct, but you have be carefull where you declare your elements and always mind program scope. Daniel E. Blanchard
  • 0 Votes
    1 Posts
    0 Views
    No one has replied
  • creating dll

    c++ question
    2
    0 Votes
    2 Posts
    0 Views
    R
    VB6 can not create DLLs that export functions like C++ can. It can only create COM DLLs. Paul Watson wrote: "At the end of the day it is what you produce that counts, not how many doctorates you have on the wall." George Carlin wrote: "Don't sweat the petty things, and don't pet the sweaty things." Unknown wrote: "I love long walks, especialy taken by those that annoy me." Paraphrased from TMNT: "Cricket? You have to know what a crumpet is to understand Cricket."
  • VB6 Mousepointer property

    help question
    1
    0 Votes
    1 Posts
    0 Views
    No one has replied
  • How do you print a project in NET

    question
    1
    0 Votes
    1 Posts
    0 Views
    No one has replied
  • Creating Activex Control in VB.Net

    asp-net csharp html com
    1
    0 Votes
    1 Posts
    0 Views
    No one has replied
  • Accessing dll's using VB

    help
    1
    0 Votes
    1 Posts
    0 Views
    No one has replied
  • Windows Service Dependencies

    csharp wcf windows-admin tools
    3
    0 Votes
    3 Posts
    0 Views
    M
    Thanks for your reply... been meaning to say that. I had the installer and just missed it somehow. DUH Anyway, your reply made me look again and there it is. Thanks alot.
  • 0 Votes
    6 Posts
    0 Views
    D
    Yopu might try posting a wm_close message to it's main window first - this will allow it to do any proper cleanup like closing files etc. Ideally you should only terminate a process using Terminateprocess if it has hung...IMHO. '--8<------------------------ Ex Datis: Duncan Jones Merrion Computing Ltd
  • Selct from Multiple Access mdb's

    database question
    3
    0 Votes
    3 Posts
    0 Views
    M
    Each user is on a standalone laptop or desktop. All databases are identical in structure. No .NET. I change the ODBC DSN when they run reports that I have created in Crystal Reports. Other than that they open the .mdb they want to update and then run the reports. No networking or servers are involved.:-D
  • Accessing an Imagelist in VB.NET

    csharp database tutorial
    3
    0 Votes
    3 Posts
    5 Views
    D
    Thanks much - that works. The images are a bit blurry but they are at least showing up now. DGW