-
Sep 25th, 2020, 04:35 AM
#1
Thread Starter
New Member
[RESOLVED] Getting a compile error : stub or function not defined error in VB6
I am creating a sample VB6 application. I used WebKitX control to embed a browser into my app. Here is my sample code
Private Sub WebKitXCEF31_OnBrowserReady()
WebKitXCEF31.ExecCommandSetFocus = True
WebKitXCEF31.FormatUsingInternalSelectionAPI = True
WebKitXCEF31.DownloadScripts = True
WebKitXCEF31.Open "http://www.google.com/"
End Sub
Private Sub WebKitXCEF31_OnCreate(ByVal Settings As WebKitXCEF3Lib.ISettings, CommandLineSwitches As
String)
Settings.cache_path = App.Path + "\MyCache"
Settings.application_cache = App.Path + "\MyAppCache"
Settings.persist_session_cookies = 1
Settings.persist_user_preferences = 1
AddLog "CommandLineSwitches=" + CommandLineSwitches
End Sub
Private Sub WebKitXCEF31_OnLoadEnd()
WebKitXCEF31.Preview
WebKitXCEF31.Events = DOM_EVENT_SELECTSTART Or _
DOM_EVENT_DOMSUBTREEMODIFIED Or _
DOM_EVENT_DOMFOCUSIN Or _
DOM_EVENT_CLICK Or _
DOM_EVENT_EDITABLE_ELEMENT_CHANGED
End Sub
The Form_Load() method is empty. When I run the application, an error is thrown at the WebKitXCEF31_OnCreate stub with the message 'Compile Error: Sub or Function not defined.'. Is there any place specific where we need to define the stub/method before implementing it? I am new to VB6 and this is the first code that i have written. This code is available on WebKitX. Link : https://www.webkitx.com/webkitx.html
-
Sep 25th, 2020, 05:17 AM
#2
Re: Getting a compile error : stub or function not defined error in VB6
do you have a sub or function addlog?
i am guessing that is the one it is not finding, test if it will run if you comment out that line
i do my best to test code works before i post it, but sometimes am unable to do so for some reason, and usually say so if this is the case.
Note code snippets posted are just that and do not include error handling that is required in real world applications, but avoid On Error Resume Next
dim all variables as required as often i have done so elsewhere in my code but only posted the relevant part
come back and mark your original post as resolved if your problem is fixed
pete
-
Sep 25th, 2020, 06:49 AM
#3
Thread Starter
New Member
Re: Getting a compile error : stub or function not defined error in VB6
Originally Posted by westconn1
do you have a sub or function addlog?
i am guessing that is the one it is not finding, test if it will run if you comment out that line
Thanks a lot sir. I don't know why i did not look at that part, every time the debugger pointed to the method declaration and i thought there was something wrong with that.
-
Sep 25th, 2020, 07:44 AM
#4
Re: Getting a compile error : stub or function not defined error in VB6
option explicit at the top of all modules, will help to prevent those type of errors
i do my best to test code works before i post it, but sometimes am unable to do so for some reason, and usually say so if this is the case.
Note code snippets posted are just that and do not include error handling that is required in real world applications, but avoid On Error Resume Next
dim all variables as required as often i have done so elsewhere in my code but only posted the relevant part
come back and mark your original post as resolved if your problem is fixed
pete
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
|