Re: A very simple OCX Question for experts



Hi, all. Thank you for your answers. What about Visual Studio 6.0 Standard
set up for ocxs iand dlls in the App directory and registering them
automatically?Any ideas??


--
Rick


"Ted" wrote:

> You need to use the API to get the System or System32 directory.
> "Put this in a module
> Option Explicit
> Declare Function GetSystemDirectory Lib "kernel32" Alias
> "GetSystemDirectoryA" (ByVal lpBuffer As String, ByVal nSize As Long) As
> Long
> Declare Function GetWindowsDirectory Lib "kernel32" Alias
> "GetWindowsDirectoryA" (ByVal lpBuffer As String, ByVal nSize As Long) As
> Long
> Public imsgResponse As Long
> Public iTextValue As String
>
>
> Function GetSysDir() As String
> Dim temp$
> Dim x As Long
> temp$ = String$(145, 0) ' Size Buffer
> x = GetSystemDirectory(temp$, 145) ' Make API Call
> temp$ = Left$(temp$, x) ' Trim Buffer
>
> If Right$(temp$, 1) <> "\" Then ' Add \ if necessary
> GetSysDir$ = temp$ + "\"
> Else
> GetSysDir$ = temp$
> End If
> End Function
>
> Function GetWinDir() As String
> Dim temp$
> Dim x As Long
> temp$ = String$(145, 0) ' Size Buffer
> x = GetWindowsDirectory(temp$, 145) ' Make API Call
> temp$ = Left$(temp$, x) ' Trim Buffer
>
> If Right$(temp$, 1) <> "\" Then ' Add \ if necessary
> GetWinDir$ = temp$ + "\"
> Else
> GetWinDir$ = temp$
>
> End If
> End Function
>
> Private Sub Command2_Click()
> Dim GSW$, GW$
> GSW$ = GetSysDir ' so it doesn't repeat calling the function
> GW$ = GetWinDir
> End Sub
>
> But like they suggested, its better to use an installer.
>
>
>
> "Rick" <Rick@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
> news:1CC23285-0579-4278-87EF-2151490737F3@xxxxxxxxxxxxxxxx
> > Hi, there.
> >
> > How can I tell any VB6 application to use an OCX which is WITH the
> > application?
> > My specific problem is with the Windows Plattform:
> > In Windows 2000, the OS folder is named WINDOWSNT. On the other hand,
> > in Windows XP, it`s named as WINDOWS(lsame for Windows 95 and 98).
> >
> > All the VB6 Applications are created and complied under Windows 2000 and
> > to
> > make them work under Windows XP, I would have to build them in the same
> > platform.
> >
> > Is there a way to register these Ocxs (which are linked to the
> > application)
> > so that
> > they would stay with the application rather than being at System32?
> > (remember the OS folder is different in both cases).
> >
> > How can I do this?
> >
> > Thank you for any help.
> >
> >
> > --
> > Rick
>
>
>
.



Relevant Pages

  • RE: GetOpen filename to open files(Workbooks)
    ... As I said previously you can't circumvent the windows security protection ... Set FileNameXls = Workbooks.Open(_ ... Dim FileNameXls As Variant ... Dim ShName As String, PathStr As String ...
    (microsoft.public.excel.misc)
  • Re: function PlaySound does not work
    ... You need to use any of several methods to get the Windows directory. ... Private Declare Function GetWindowsDirectory Lib "kernel32" Alias "GetWindowsDirectoryA" (ByVal lpBuffer As String, ByVal nSize As Long) As Long ... Public Function GetWinDir() As String ... Dim sBuffer As String ...
    (microsoft.public.vb.winapi)
  • Re: RegOpenKeyEx() on 64 bit Windows
    ... I need my VB code to work on 32 bit Windows and 64 bit ... As String) As Long ... Dim hLib As Long ... > Dim sReturn As String ...
    (microsoft.public.win32.programmer.kernel)
  • Re: impersonate user in windows forms
    ... > The following example demonstrates how to impersonate a user and then ... > Public Shared Function LogonUser(lpszUsername As String, ... > 'The Windows NT user token. ... > Dim token1 As Integer ...
    (microsoft.public.dotnet.languages.vb)
  • Search pattern
    ... Dim strfile As String ... Dim bAddressFound As Boolean ... Dim strCurrentChar As String ...
    (comp.databases.ms-access)

Loading