-
Apr 16th, 2018, 06:43 AM
#1
Thread Starter
Lively Member
How to embedd own font and external application to VB6 project?
Hi!
I need to help with embedding own font and application into VB6 project.
I need to do it so, that font used in finished program will be not required installed on other computer.
I need also embedd application - exactly single EXE file (written in C) and start it by code in project and of course will be not required external copy.
Else one Q is if is possible to use Common Dialog Control in project and finished program will not require to have it in system - is it possible? I know to create own open/save dialogs, but this way can be easier and even better.
Can anybody help me?
Thank you for all.
Miro
-
Apr 16th, 2018, 11:01 AM
#2
Re: How to embedd own font and external application to VB6 project?
I would say do not try to embed either. Instead create a proper installer that installs your program, the font and the external exe as well as any other support files that may be needed.
No you can not use a control that does not exist on the target system. It must be included as part of your install routine in order for it to work.
You can however use API instead of the control and not need the control on the system.
-
Apr 16th, 2018, 11:48 AM
#3
Re: How to embedd own font and external application to VB6 project?
In a module
Code:
Option Explicit
Private Declare Function AddFontResourceEx Lib "gdi32" Alias "AddFontResourceExA" _
(ByVal sFileName As String, ByVal lFlags As Long, ByVal lReserved As Long) As Long
Private Const FR_PRIVATE As Long = &H10
Public Sub InstallFonts()
InstallFont "MyFont"
InstallFont "MyFont Bold"
InstallFont "MyFont Italic"
End Sub
Private Function InstallFont(pFontName As String)
Dim lRet As Long
lRet = AddFontResourceEx(App.Path & "\" & pFontName & ".ttf", FR_PRIVATE, 0&)
End Function
If you don't know where you're going, any road will take you there...
My VB6 love-children: Vee-Hive and Vee-Launcher
-
Apr 16th, 2018, 11:54 AM
#4
Thread Starter
Lively Member
Re: How to embedd own font and external application to VB6 project?
I want to embedd external app and font to release it as standalone exe.
Miro
-
Apr 16th, 2018, 12:00 PM
#5
Re: How to embedd own font and external application to VB6 project?
I only have a second, but I use controls that aren't on a target computer all the time. That's precisely what the SxS technology is for, discussed here. Also, near the end of that tutorial, it talks about how to wrap these OCX files into your EXE file (using your resources).
Furthermore, I have little doubt I could also put a font into my resources, unpack it, and temporarily "install" it for my own use. This doesn't seem like a huge deal to me, but I suppose it is of intermediate VB6 level. You wouldn't even need administrative rights (if it were a temporary install). I'd outline it, but I just don't have the time at the moment.
Good Luck Though,
Elroy
Any software I post in these forums written by me is provided "AS IS" without warranty of any kind, expressed or implied, and permission is hereby granted, free of charge and without restriction, to any person obtaining a copy. To all, peace and happiness.
-
Apr 16th, 2018, 12:13 PM
#6
Re: How to embedd own font and external application to VB6 project?
Originally Posted by Bonnie West
Last edited by Victor Bravo VI; Apr 16th, 2018 at 12:46 PM.
-
Apr 16th, 2018, 12:54 PM
#7
Re: How to embedd own font and external application to VB6 project?
Victor beat me to it, but I would also go with AddFontMemResourceEx, and just keep the Font embedded in the EXE
-
Apr 16th, 2018, 02:14 PM
#8
Re: How to embedd own font and external application to VB6 project?
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|