IPControl

Started by dacarle, December 05, 2006, 10:44:19 AM

Previous topic - Next topic

dacarle

Does anyone have any sample code to both set and read from the IPControl?

Thanks

-David

TechSupport

To set an address:
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/shellcc/platform/commctls/ipaddress/messages/ipm_setaddress.asp

SendMessage hWndControl, %IPM_SETADDRESS, 0, MAKEIPADDRESS(255,255,255,255)



To get an address:
http://msdn.microsoft.com/library/en-us/shellcc/platform/commctls/ipaddress/messages/ipm_getaddress.asp

  Local nAddress As Dword
 
  SendMessage HWND_FORM1_IPCONTROL1, %IPM_GETADDRESS, 0, VarPtr(nAddress)
 
  MsgBox Str$( FIRST_IPADDRESS(nAddress) ) & _
         Str$( SECOND_IPADDRESS(nAddress) ) & _
         Str$( THIRD_IPADDRESS(nAddress) ) & _
         Str$( FOURTH_IPADDRESS(nAddress) )

TechSupport


dacarle


dacarle

It seems the IPControl does not want to play nicely.  I loaded a form that had worked fine in an older project, however, the following seems to happen


1) the IP control does not seem to accept the sendmessage
2) when I have the control on a form and close the form and return to other forms, it seem to change the font on those forms

-David

TechSupport

Hi David,

Is this the same project that you emailed me about yesterday (re: the tab control icon issue)? If it is, then the symptoms indicate to me that there is a corruption in the project somewhere (either caused by FireFly or code executing in your project causes FireFly to react badly).

If your project is not confidential, would you be able to email it to me. There is no need for you to be struggling with a project that is behaving not like it should.

(Did you import a form from another project? Did the problems start after you did that?)

dacarle

I just sent the entire project and icons off to you.

John Montenigro

I just added these routines to my project, and I lost all syntax coloring, too. (FF ver 2.75)

Reading your additional questions in the above posts to David, I remember that this occurred after I deleted a Module from the project (in order to put that module's name in User_Includes.inc).




-John

dacarle

John-

Where abouts in New Jersey are you located?

-David

John Montenigro

About 20 miles west of NYC, in Essex County. Are you a neighbor?

-John

dacarle

I grew up in Essex County, West Orange.  Currently live in Westfield.

TechSupport

Hey Dave,

I got the project. I deleted the CODEGEN_ files and attempt to do a full compile (simply pressing F5). I believe that the first two projects failed on the "Communications-1.inc" file (undefined variables).

I did get an error creating the RES file but it was because you had a Code Output Directory defined in the Project that, of course, did not exist on my computer.

What project did you want me to test? PCR-1.prj, PCR-2.prj or PCR-3.prj ?

BTW, I did notce the font problem when your logon form regained focus. Weird. Once I get the main project able to be compiled then I will trace where the font problem resides.

dacarle


TechSupport

Dave,

The font problem is related to the way the IP Control handles assigned fonts. In a recent version of FireFly, I switched from assigning individual font objects to each created control to a system whereby a common font (say, Tahoma size 10) is applied to multiple controls and the font exists for the life of the program (via a global array). This greatly reduces the GDI resource usage for large programs.

It appears that when the IP Control is destroyed (i.e. when the Form closes), the assigned font to the IP Control is also deleted. Because the font is deleted, all controls that previously relied on that font handle are also affected. That is why you are seeing the fonts revert back to the system font.

In this case, I will need to modify the code generator to create a unique font handle for each IP Control rather than apply any previously created handles. Simple fix actually.

I will also have to test to see if other Common Controls exhibit this behaviour.

I will upload a fix to the FFengine.exe later this evening.

:)

John Montenigro

Paul, I've been following along and playing with the posted code. I was also getting the "surprise me" font option...  :D

I see that you've tracked down the problem, so while I'm playing with it, what other controls do you want tested?

-John

It's NOT happening with:

- label
- command button
- image button
- textbox
- checkbox
- option button
- frame
- picture
- combobox
- listbox
- HS bar
- VS bar
- timer
- tab
- rich edit
- progress bar
- up down
- listview
- treeview
- slider
- date/time picker
- monthly calendar
- OCX
- pbvlist
- rr button
- SI grid demo
- EGrid32 (professional)

That's all the controls I've got on the FF panel. I don't have code for any others.  Problem is only with the IP control...