Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Imagelist Unknown Com Status
Message
From
04/07/2001 05:46:53
 
 
To
03/07/2001 16:21:53
General information
Forum:
Visual FoxPro
Category:
ActiveX controls in VFP
Miscellaneous
Thread ID:
00526466
Message ID:
00526620
Views:
20
This message has been marked as the solution to the initial question of the thread.
Hi!

LoadPicture cannot use images compiled into the EXE. Exclude these images from the project to do not add them into the EXE file, and it will go well. Or, copy image file from EXE to disk temporary file, use that file in LoadPicture, than delete temporary file. You can copy image from EXE to disk by STRToFile(FilToStr("folder.ico"),'TempFile.ico') function, but if it fails (there are reports that FileToStr() fail to get file compiled into EXE), use another way:
create cursor aaa (mmm M)
select aaa
append blank
append memo mmm from "folder.ico"
StrToFile(aaa.mmm,'TempFile.ico')
If this is not a problem in LoadPicture, than try to put DOEVENTS after each picture adding, of set _VFP.AutoYield=.T. before that code - the problem might be in the events not processed correctly for ActiveX. Finally, I always use ImageList ActiveX control by putting it on the form in design-time. Not sure if it will work in run-time.

Thats all that I know could be a source of this problem.

HTH.

>I have a form with a treeview control on it. In the forms init I have
>
>THIS.oImageList = CreateObject('MSComCtlLib.ImageListCtrl')
>WITH THIS.oImageList.ListImages
>   .Add(1,"folder",  LoadPicture("folder.ico"))
>   *-- A buch of other adds
>ENDWITH
>THIS.ole_TreeView.ImageList = THIS.oImageList
>
>
>When I run the form though foxpro it runs just fine. I make an exe out of it and I get Unknow Com status code. I traced it down to the imagelist and the adds but if I take out the adds then I get the error imagelist must be init. I don't know what to do next. I have added the imagelist to the form with an olecontrol instead of the createobject and it still does the same thing. Any help?
Vlad Grynchyshyn, Project Manager, MCP
vgryn@yahoo.com
ICQ #10709245
The professional level of programmer could be determined by level of stupidity of his/her bugs

It is not appropriate to say that question is "foolish". There could be only foolish answers. Everybody passed period of time when knows nothing about something.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform