Visual Basic

    Sponsored Links


  • 1. 'Could not create COM object' Error
    All is well while testing my ActiveX EXE app via the IDE. Once I built the driver app and tried to connect via another program I get an error that states 'Could not create COM object'. Any ideas. Like I said, while debugging via VB6 Maxim opens the driver just fine. How would I debug this if it behaves well when run from within VB6? Thanks!! -- Regards, Chuck
  • 2. Adding date to SQL
    I trying to add a date into sql database. Here is my code: cm.commandtext = nsert into Table1 values (€& DTPicker1 & € cm.activeconnection = cn cm.execute Table1 consists of one column atawith Data Type = datetime. When run an error message appear that says smth wrong with the code near I appreciate any help.
  • 3. how to resize gif? (AnimatedGif.ocx)
    Hello; I am using activex control for gif image AnimatedGif.ocx But I could not resize it as per my need. There is no stretch option in the properties. How to resize my gif image ? --Kaps
  • 4. how to search a?
    hello; Whenever I search for the single character eg a with code p_v = InStr(p_v + 1, RichTextBox1.Text, "a", vbTextCompare) I get unwanted search in richtextbox that I am searching in. eg I am searching "a" This is aa test line This is a test line It searches "aa" and then "a" I dont want aa to be searched. What are the modification required? Please help Thnaks --kaps
  • 5. PopupMenu doesn't
    VB6SP6 On a form shown with vbModal, the PopupMenu does not work. The form has no caption bar (ControlBox False) If I make the menu visible, it shows on this form (even without the Caption) at the top and works. I do not want the menu showing unless the user right-clicks the form (for a popupmenu). How do I get the popupmenu to work on this modal form?


Postby Mark Field » Wed, 12 Nov 2003 23:24:37 GMT

When I insert the code below, it claims that there is a User Defined Type
Not Defined.  In the cases below, it's refering to SYSTEM_INFO and
OSVERSIONINFO.  Are there reference libraries I need for this to be able to
compile?    Any ideas?  Thanks!

Private Declare Sub GetSystemInfo Lib "kernel32" (lpSystemInfo As
Private Declare Function GetVersionEx Lib "kernel32" Alias "GetVersionExA"
(lpOSInfo As OSVERSIONINFO) As Boolean

Private Declare Function api_GetUserName Lib "advapi32.dll" Alias
"GetUserNameA" (ByVal lpBuffer As String, nSize As Long) As Long

Re: kernal32

Postby Bob Butler » Wed, 12 Nov 2003 23:34:01 GMT

With VB you need to copy the type definitions into your code; there is an
API viewer wth VB that lets you find them or you can search
 http://www.**--****.com/  or
 http://www.**--****.com/ (the latter
will give you C++ definitions which must be translated (by you) to VB)

  dwOSVersionInfoSize As Long
  dwMajorVersion As Long
  dwMinorVersion As Long
  dwBuildNumber As Long
  dwPlatformId As Long
  szCSDVersion As String * 128
End Type
Private Type SYSTEM_INFO
  dwOemID As Long
  dwPageSize As Long
  lpMinimumApplicationAddress As Long
  lpMaximumApplicationAddress As Long
  dwActiveProcessorMask As Long
  dwNumberOrfProcessors As Long
  dwProcessorType As Long
  dwAllocationGranularity As Long
  dwReserved As Long
End Type
Private Declare Function GetVersionEx Lib "kernel32" Alias "GetVersionExA" _
  (ByRef lpVersionInformation As OSVERSIONINFO) As Long
Private Declare Sub GetSystemInfo Lib "kernel32" _
  (ByRef lpSystemInfo As SYSTEM_INFO)

Return to Visual Basic


Who is online

Users browsing this forum: No registered users and 57 guest