Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > Visual Basic > VB 6 Visual Basic 6 > VB How-To
Password Reminder
Register
Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
VB How-To Ask your "How do I do this with VB?" questions in this forum.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the VB How-To section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Display Modes
  #1 (permalink)  
Old June 18th, 2007, 11:59 AM
Registered User
 
Join Date: Jun 2007
Location: Dundee, , United Kingdom.
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default Help : compile error : sub or function not defined

I was given a program and edited the forms and when i try to compile it i get the above error and it highlights the txt below, can someone please tell me the problem if possible?


Private Sub cmdRun__404760()

404760: push ebp <<<< it highlights push
404761: mov ebp, esp
00404763: sub esp, 0000000Ch
00404766: push 00401196h
40476 B: mov eax, fs: [00h]
404771: push eax
404772: mov fs: [00000000h] , esp
00404779: sub esp, 0000001Ch
40477 C: push ebx
0040477D: push esi
0040477E: push edi
40477 F: mov [ebp-0Ch], esp
00404782: mov [ebp-08h], 00401100h
404789: mov esi, [ebp+08h]
40478 C: mov eax, esi
0040478E: and eax, 00000001h
404791: mov [ebp-04h], eax
00404794: and esi, FFFFFFFEh
404797: push esi
404798: mov [ebp+08h], esi
40479 B: mov ecx, [esi]
0040479D: call [ecx+04h]
4047 A0: mov edx, [esi]
004047A2: xor eax, eax
4047 A4: push esi
4047 A5: mov [ebp-18h], eax
4047 A8: mov [ebp-1Ch], eax
4047 AB: Call [edx+00000304h]
4047 B1: mov ebx, [00401044h]
4047 B7: push eax
4047 B8: lea eax, [ebp-1Ch]
4047 BB: push eax
4047 BC: Call ebx
4047 BE: mov edi, eax
4047 C0: lea edx, [ebp-18h]
4047 C3: push edx
4047 C4: push edi
4047 C5: mov ecx, [edi]
4047 C7: Call [ecx+50h]
4047 CA: test eax, eax
4047 CC: fclex

Reply With Quote
  #2 (permalink)  
Old June 18th, 2007, 01:39 PM
Friend of Wrox
 
Join Date: Nov 2004
Location: Port Orchard, WA, USA.
Posts: 1,621
Thanks: 1
Thanked 3 Times in 3 Posts
Default

“Private Sub cmdRun__404760()” is a legitimate piece of VB syntax; the compiler will be able to understand that string as the beginning of a sub. But the rest of what you posted is what would be visible in the development environment for writing assembly language. That is not legitimate VB syntax, and the compiler will have no way to interpret it.

VB is willing to see a number followed by a colon as the beginning of a line, and designating the line number (this is a holdover from long ago; VB doesn't use line numbers anymore).

So then it comes to “push,” which has no meaning in VB unless you actually have created a routine called push. In assembly language, that would mean to place the value referred to in the argument (ebp in this case) onto the stack.

I don't know how this code you received came to be, but it is not compilable.
Reply With Quote
  #3 (permalink)  
Old June 20th, 2007, 04:34 AM
Registered User
 
Join Date: Jun 2007
Location: Dundee, , United Kingdom.
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default

thanks for your information.

i received the code by decompiling a program i was given which apparantly cant be recompiled.

Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Appl-defined or Object-defined error 1004 chp Excel VBA 3 April 4th, 2006 08:12 AM
error function not defined Dj Kat Ajax 6 March 6th, 2006 11:02 AM
Compile Error: Variable not defined Fin Excel VBA 0 February 1st, 2006 12:45 PM
Compile error-variable not defined tmiller1 VB Databases Basics 1 February 15th, 2005 03:15 PM
Application-defined or object-defined error James Excel VBA 1 August 12th, 2003 11:50 PM



All times are GMT -4. The time now is 11:08 AM.


Powered by vBulletin®
Copyright ©2000 - 2018, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.