Re: A very simple OCX Question for experts
- From: "Rick" <Rick@xxxxxxxxxxxxxxxxxxxxxxxxx>
- Date: Wed, 10 Aug 2005 12:29:03 -0700
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
>
>
>
.
- References:
- A very simple OCX Question for experts
- From: Rick
- A very simple OCX Question for experts
- Prev by Date: msado27.tlb has missing dependency info
- Next by Date: Re: Async Callback (Part 2)
- Previous by thread: Re: A very simple OCX Question for experts
- Next by thread: Re: A very simple OCX Question for experts
- Index(es):
Relevant Pages
|
Loading