PlanetSquires Forums

Please login or register.

Login with username, password and session length
Advanced search  

Author Topic: error 42: Variable not declared  (Read 253 times)

jermy

  • Little Newbie
  • *
  • Posts: 28
error 42: Variable not declared
« on: November 11, 2019, 02:10:02 PM »

Why i cant use QueryFullProcessImageName?

Main.bas
Code: [Select]
#Include Once "windows.bi"   
#Include Once "win/winbase.bi"
#Include Once "win/wincrypt.bi"
#Include Once "Form1.inc"
''
''  Remove the following Application.Run code if it used elsewhere in your application.
Application.Run(Form1)

Form1.inc
Code: [Select]
''
''
Function Form1_Button1_Click( ByRef sender As wfxButton, ByRef e As EventArgs ) As LRESULT

Dim Ret as WINBOOL
    Ret = FindClose(0)                                                   'winbase.bi
    Ret = IsDebuggerPresent                                          'winbase.bi 

   Ret = QueryFullProcessImageName(0, 0, 0, 0)            'winbase.bi

   print AfxGetWinErrMsg(GetLastError)

   Function = 0
End Function

The compiler says 'error 42: Variable not declared , QueryFullProcessImageName ...
I forgot to add something?.
Logged

Josť Roca

  • Guru Member
  • *****
  • Posts: 3217
Re: error 42: Variable not declared
« Reply #1 on: November 11, 2019, 02:54:52 PM »

> I forgot to add something?.

Yes. Put

#define _WIN32_WINNT &h0602

before the includes.

jermy

  • Little Newbie
  • *
  • Posts: 28
Re: error 42: Variable not declared
« Reply #2 on: November 11, 2019, 03:02:38 PM »

that works, why didn't I think about that myself?

Tnx Josť
Logged