WriteUInt not exist

Dec 28, 2008 at 10:58 AM
Hi
Help please!

I get error message 'WriteUInt.prg not exist' in ctl32_structures in the following procdure.

 

 

Procedure cbSize_Assign(pnNewVal)

 

WriteUInt(

 

This.Address, m.pnNewVal)

 

 

 

Endproc

**I get it when I try to open form with Explorer bar (the error apeared most of the times but not always, its seems that explorer bar very pedantic on location, form state and other objects on the form, not clear).

Thanks

 

Jan 2, 2009 at 6:49 AM
Oh,
Half solutiom!?
I have to close VFP and to reopen after any change in themeform.
The second half?
Developer
Jan 5, 2009 at 5:37 PM
Hi Chaim.
Didn't understand whats happening.
The error occurs at design time?
Could you give more details about the error or send me some sample to reproduce?

Thanks a lot!
Jan 6, 2009 at 6:31 AM
Hi,
I got the error on runtime.
The problem vanished in most of the cases (I got it one time or two) since I update the theme controls classes and the system.prg.
Any way, if I close vfp and reopen vfp I dont a have any problem.
Now I have other problem (can be correlation to previous?) I started to use with ctl32 progress bar and I get error message about BindWindowsEventsProxy wile I try to exit app.
How do I have to handle 'BindWindowsEventsProxy' class?
Here is code from my base application (two blocks, one start.prg and theother is sysproc.prg), you can see that I marked the BindWindowsEventsProxy as comment since I got errors.
Big thanks for help or any other suggestion about this subject.
Chaim
1. start.prg

**** start app ****

local lerrorflag,cerror,cdatabase,nloop,nanswer,lfrmlogin,cdbcname,nlength,cfd124,cdestinationcopy,lcdefaultpath

*!* * Destroy ThemesManager object

if vartype(_screen.themesmanager)=="O"

_screen.removeobject("ThemesManager")

endif

*!* * Destroy BindWindowsEventsProxy object

*!* If Vartype(_vfp.BindWindowsEventsProxy)=="O"

*!* _vfp.BindWindowsEventsProxy = Null

*!* Endif

set procedure to sysproc additive

oapp=createobject('clSystem')

set procedure to stest additive

do form splash name oapp.frmsplash linked

do header

oapp.startdir=sys(5)+curdir()

local lcdefaultpath

if _vfp.startmode = 0 and ;

type("_vfp.ActiveProject")=="O"

lcdefaultpath = _vfp.activeproject.homedir

set path to (addbs(lcdefaultpath)+"VCX") additive

set path to (addbs(lcdefaultpath)+"CLASSES") additive

else

lcdefaultpath = sys(5)+sys(2003)

endif

set path to (addbs(lcdefaultpath)+"Images") additive

set path to (addbs(sys(5)+sys(2003))) additive

set path to (addbs(sys(5)+sys(2003))) additive

do locfile("System.App")

oapp.startdir=sys(5)+curdir()&&oApp.startdir save the current path where did we start running the EXE

if file(oapp.startdir+'Themes.xml')=.f.

if directory('P:\fxml')=.t.

cdestinationcopy=oapp.startdir+'Themes.xml'

copy file p:\fxml\themes.xml to (cdestinationcopy)

endif

endif

**** open config.dbf

select 0

cerror=on("ERROR")

on error lerrorflag=.t.

use config shared

on error &cerror.

if lerrorflag=.t.

=messagebox("Cannot Open Config.dbf",0+16,oapp.msgtitle)

do footer

return

endif

**** open settings.dbf

select 0

cerror=on("ERROR")

on error lerrorflag=.t.

use settings shared

on error &cerror.

if lerrorflag=.t.

oapp.settingflag=.f.

else

oapp.settingflag=.t.

endif

lerrorflag=.f.

cdbcname=alltrim(config.datadir)+oapp.dbcname+".dbc"&&DY data base name:mydbc.dbc

nlength=len(oapp.dbcname)+4 && add '.dbc'

wait window "Open Database" nowait

cerror=on("ERROR")

on error lerrorflag=.t.

_screen.visible=.t.

cdatabase=alltrim(locfile(cdbcname,"dbc"))

_screen.visible=.f.

on error &cerror.

if lerrorflag=.t.

wait clear

do footer

return

endif

if upper(right(cdatabase,nlength))<>upper(oapp.dbcname)+".DBC"

wait clear

=messagebox("Wrong Database!",0+16,oapp.msgtitle)

do footer

return

endif

wait clear

cerror=on("ERROR")

on error lerrorflag=.t.

open database &cdatabase. shared

on error &cerror.

if lerrorflag=.t.

=messagebox("Cannot Open Database",0+16,oapp.msgtitle)

do footer

return

endif

if upper(left(cdatabase,len(cdatabase)-nlength))<>upper(alltrim(config.datadir))

replace config.datadir with left(cdatabase,len(cdatabase)-nlength)

endif

**** start application

do form topform name oapp.topform linked&&run main form

read events

if type("oApp")="O" and not isnull(oapp) && it might be helpful :)

do footer

endif

return

define class clsystem as custom

version="3.1"

msgtitle="My Company"

dbcname="mydbc"

userid=''

ownerid=0

errorind=0

quitflag=.f.

topform=.null.

frmlogin=.null.

startdir=""

debugflag=.f.

register1=.f. && for dynamic multi-object processes, sometimes can be object!

settingflag=.f. && for saving individual settings

frmsplash=.null.

blockmenu=.f.

enddefine

*!* Define Class bindeventproxy As Custom

*!* _wparam = 0

*!* _lparam = 0

*!* _hwnd = 0

*!* _result = .Null.

*!* _msg = 0

*!* _windowproc = 0

*!* Name = "bindeventproxy"

*!* Procedure _msghandler

*!* Lparameters HWnd As Integer, Msg As Integer, wParam As Integer, Lparam As Integer

*!* Local lnResult

*!* This._hwnd = m.HWnd

*!* This._wparam = m.wParam

*!* This._lparam = m.lParam

*!* This._msg = m.Msg

*!* If Isnull(This._result) Then

*!* m.lnResult = CallWindowProc(This._windowproc, m.HWnd, m.Msg, m.wParam, m.lParam)

*!* Else

*!* m.lnResult = This._result

*!* This._result = .Null.

*!* Endif

*!* Return m.lnResult

*!* Endproc

*!* Procedure Init

*!* #Define WM_THEMECHANGED 0x031A

*!* #Define GWL_WNDPROC (-4)

*!* Declare Integer GetWindowLong In win32api ;

*!* Integer HWnd, ;

*!* Integer nIndex

*!* Declare Integer CallWindowProc In win32api ;

*!* Integer lpPrevWndFunc, ;

*!* Integer HWnd, ;

*!* Integer Msg,;

*!* Integer wParam,;

*!* Integer Lparam

*!* This._windowproc = GetWindowLong(_vfp.HWnd, GWL_WNDPROC)

*!* If Type("This.Parent") # "O" Then

*!* Bindevent(_vfp.HWnd, WM_THEMECHANGED, This, "_MsgHandler", 4)

*!* Else

*!* If Type("This.Parent.HWnd") = "N" Then

*!* Bindevent(This.Parent.HWnd, WM_THEMECHANGED, This, "_MsgHandler", 4)

*!* Endif

*!* Endif

*!* Endproc

*!* Enddefine

2. sysproc.prg

procedure header

set talk off

on error do errorhandler with program(),lineno(1)

clear

close data all

close tables all

set exclusive off

set escape on

set deleted on

set exact on

set confirm off

set near on

set multilocks on

set sysmenu to

set path to

set reportbehavior 80

set classlib to s1a

set classlib to s1b additive

set classlib to s1c additive

set classlib to s2 additive

set classlib to s3 additive

set classlib to s4a additive

set classlib to s4b additive

set reprocess to automatic

set collate to 'MACHINE'

set century off

set century to 19 rollover 15

=hidescreen()

_screen.caption="My company"

_screen.icon="s.ico"

_screen.fontname="Arial"

_screen.fontsize=8

_screen.fontbold=.f.

_screen.themes=.f.

set status bar off

on shutdown do quitapp

on key label f1 do functionkey

on key label f2 do functionkey

on key label f3 do functionkey

on key label f4 do functionkey

on key label f5 do functionkey

on key label alt+f5 do functionkey

on key label f6 do functionkey

on key label f7 do functionkey

on key label f8 do functionkey

on key label f9 do functionkey

on key label f10 do functionkey

on key label f11 do functionkey

on key label f12 do functionkey

on key label alt+f11 do functionkey

on key label alt+f12 do functionkey

on key label alt+f10 do printscreen with 2

on escape do escapekey

return

endproc

procedure footer&&set environment to default for application quit

wait window 'Closing... Wait, Please!' nowait

close data all

close tables all

set escape on

set deleted off

set exact off

set multilocks off

set sysmenu to default

set path to

set classlib to

set exclusive on

set notify on

oapp.topform=.null.

oapp.register1=.null.

release all

=showscreen()

_screen.caption="Microsoft Visual Foxpro"

set status bar on

on shutdown

on key

on error

on escape

set procedure to

clear all

wait clear

set talk on

return

endproc

procedure escapekey&&

if type('oApp')<>'O' or isnull(oapp)

on shutdown

cancel

return

endif

if messagebox('Do You Really Want To Cancel Processing And Close The System?', ;

4+32,oapp.msgtitle)<>6

retry

endif

on shutdown

clear events

cancel

quit

return

endproc

procedure functionkey&&F1-F12 keybord keys functions

if type('oApp.topform.tbMain')<>'O'

return

endif

oapp.topform.functionkey()

return

endproc

function showscreen

_screen.left=0

_screen.windowstate=2

_screen.caption=""

_screen.visible=.t.

return

endfunc

function hidescreen&&hide form (without release)

_screen.left=-2000

_screen.windowstate=2

_screen.caption=""

_screen.visible=.f.

return

endfunc

procedure showtable

lparameter calias

=showscreen()

select (calias)

browse

=hidescreen()

return

endproc

procedure quitapp&&stop event processing

on shutdown

If Vartype(_Screen.ThemesManager)=="O"

_Screen.RemoveObject("ThemesManager")

Endif

*!* If Vartype(_vfp.BindWindowsEventsProxy)=="O"

*!* _vfp.BindWindowsEventsProxy = Null

*!* Endif

if type('oApp')<>'O'

clear events

return

endif

if type('oApp.topform.tmrTop')=='O' and not isnull(oapp.topform.tmrtop)

oapp.topform.closemodalforms()

oapp.topform.tmrtop.enabled=.t.

else

oapp.quitflag=.t.

clear events

endif

return

endproc

function closeapp

local cmessage,csettingcontents,nday

cmessage='Do You Want To Quit?'

oapp.topform.tmrprocess.timer(.t.,.t.)

if messagebox(cmessage,4+32,oapp.msgtitle)<>6

return .f.

endif

return .t.

endfunc

procedure errorhandler&&on error case - handle and save the error details on syserror table for documntation

parameter cprogram,nline

local nanswer

local array aerrorinfo(7)

=aerror(aerrorinfo)

if used('syserror')

insert into syserror (userid,sysinfo,created,linenum,errornum,errormsg,progname) ;

values(oapp.userid,sys(0),datetime(),nline,aerrorinfo[1],aerrorinfo[2],cprogram)

endif

nanswer=messagebox("Application Error: "+aerrorinfo[2]+". Program "+cprogram+ ;

". Line "+alltrim(str(nline)),2+16,oapp.msgtitle)

do case

case nanswer=3 && abort

oapp.errorind=1

do quitapp

on error

* cancel

case nanswer=4 && retry

retry

case nanswer=5 && ignore

oapp.errorind=1

endcase

*do form errorhnd name frmErrorhnd

return

endproc

***
end

From: EmersonReed [mailto:notifications@codeplex.com]
Sent: Monday, January 05, 2009 8:38 PM
To: Chaim
Subject: Re: WriteUInt not exist [VFPX:43081]

From: EmersonReed

Hi Chaim.
Didn't understand whats happening.
The error occurs at design time?
Could you give more details about the error or send me some sample to reproduce?

Thanks a lot!
Developer
Jan 9, 2009 at 11:51 AM
Hi Chaim.

Seems to be a problem with Ctl32_Scrollbar control that is used in ThemedExplorerBar.
I'll try to contact Ctl32 manager and talk about it.

Please, when you start new discussions about ThemedControls, please start the discussion title with "ThemedControls".
This way I can easily identify the discussions and answer faster.
Ok?

Cheers.
Jan 13, 2009 at 10:02 AM
Aha
I found the bug!?
I added vfp2c32.fll to my project (excluded).

In ctl32.prg, after the first line (#Include ctl32.h), I added the two following lines:

Declare Integer ReadInt In vfp2c32.fll Integer

Declare WriteInt In vfp2c32.fll Integer, Integer

I don't get any error message now.
Please let me ask if its real solution or/else alert that all ctl32_vfp2c32.prg not runnung (path?)
Thank's


From: EmersonReed [mailto:notifications@codeplex.com]
Sent: Friday, January 09, 2009 8:51 PM
To: Chaim
Subject: Re: WriteUInt not exist [VFPX:43081]

From: EmersonReed

Hi Chaim.

Seems to be a problem with Ctl32_Scrollbar control that is used in ThemedExplorerBar.
I'll try to contact Ctl32 manager and talk about it.

Please, when you start new discussions about ThemedControls, please start the discussion title with "ThemedControls".
This way I can easily identify the discussions and answer faster.
Ok?

Cheers.
Developer
Jan 19, 2009 at 10:18 AM
Hi Chaim!
Looking at Ctl32.prg, I found that Ctl32 controls search for Vfp2c32.fll (as you noticed) and, if not found, create it.
If you added Vfp2c32.prg to your project, seems that you don't need to distribute any file with your application.
I really don't know why it isn't working.
Despite of this, I've created a discussion in Ctl32 forum and I'm waiting an answer from Carlos Alloatti.
If you want to follow this discussion, here is the link:
http://ctl32.freeforums.org/ctl32-scrollbar-t60.html

Regards,

Emerson
Jan 20, 2009 at 9:57 AM
Edited Jan 20, 2009 at 10:13 AM


Thanks
I had lot of sleeplessness about this,
I got new error after my last message:
I was able to run OR ctl32 OR themecontrols on same runtime.
But if run both even seperate (to open ctl32 form, to close the form and to open the themcontrols form)
I got different error message.
Now I did the following and it's good but I have huge EXE.
In ctl32.prg I added (after #Include ctl32.h)

try

Declare Integer ReadInt In vfp2c32.fll Integer

Declare WriteInt In vfp2c32.fll Integer, Integer

Declare WriteUInt In vfp2c32.fll Integer, Integer

endtry

I added 'try' also on inheritwindowstheme_assign method (themescontrol\themesmanager class) I added (after if pemstatus(_vfp,"BindWindowsEventsProxy",5)

 

try

 

unbindevents(_vfp.bindwindowseventsproxy,"_Msg",this,"WindowsThemeChanged")

catch to ccc

endtry

 

In addition, I added the Vfp2c32.fll twice, one excluded and one external (on EXE folder).
Now I sleep a little better.

From: EmersonReed [mailto:notifications@codeplex.com]
Sent: Monday, January 19, 2009 1:18 PM
To: Chaim
Subject: Re: WriteUInt not exist [VFPX:43081]

From: EmersonReed

Hi Chaim!
Looking at Ctl32.prg, I found that Ctl32 controls search for Vfp2c32.fll (as you noticed) and, if not found, create it.
If you added Vfp2c32.prg to your project, seems that you don't need to distribute any file with your application.
I really don't know why it isn't working.
Despite of this, I've created a discussion in Ctl32 forum and I'm waiting an answer from Carlos Alloatti.
If you want to follow this discussion, here is the link:
http://ctl32.freeforums.org/ctl32-scrollbar-t60.html

Regards,

Emerson
Jan 16, 2011 at 4:54 PM

Hi,

I had similar troubles. I get error like "Function READINT is not found" or something like this in some method in CTL32 classes.

I found functions like ReadInt8 in vfp2c32.fll, but nowhere READINT.

Then I found that READINT is exported from FLL library into "system", but it is NOT exported into VFP like function reachable for fox nativelly.

So fn. readint() is reachable only after DECLARE ....

It seems that vfp2c32.fll internally declare readint() due to EXECUTE('DECLARE ....') function from C++ core code. Maybe in load event.

 

So, everytime when my program crash while debugging and then clears memory and does CLEAR DLLS, readint() disappear for fox..

Due the fact that my program does not release any FLL library from memory (I would like to have fns. from FLL in Command window)

there are situations when VFP2C32 IS LOADED in memory, but READINT() and so on is not DECLARed.

Code in ctl32_vfp2c32.prg, what loades FLL library, does the test  simply like:

If "VFP2C32.FLL" $ Upper(Set("Library")) Then RETURN   else .. LOAD FLL

 

So I  guess modifyng this routine will help get out of this troubles.

I did not want modify code directly in ctl32.prg, so I added at start of my program test like:

*-- if vfp2c32 is loaded in ram

if atc('vfp2c32.fll',set('library'))#0

*-- release it, ctl32 will need to load it again

release library vfp2c32.fll

endif

Then troubles disappeared.

 

Uf, I hope it will help someone. (pls. sorry my English)

Tomas