PlanetSquires Forums

Support Forums => Other Software and Code => Topic started by: dacarle on December 05, 2006, 10:44:19 AM

Title: IPControl
Post by: dacarle on December 05, 2006, 10:44:19 AM
Does anyone have any sample code to both set and read from the IPControl?

Thanks

-David
Title: IPControl
Post by: TechSupport on December 05, 2006, 11:00:40 AM
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) )
Title: IPControl
Post by: TechSupport on December 05, 2006, 11:01:48 AM
All information for the IP Control can be found here:
http://msdn.microsoft.com/library/en-us/shellcc/platform/commctls/ipaddress/reflist.asp
Title: IPControl
Post by: dacarle on December 05, 2006, 11:03:56 AM
Thanks
Title: IPControl
Post by: dacarle on December 05, 2006, 11:34:34 AM
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
Title: IPControl
Post by: TechSupport on December 05, 2006, 11:58:53 AM
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?)
Title: IPControl
Post by: dacarle on December 05, 2006, 12:09:00 PM
I just sent the entire project and icons off to you.
Title: IPControl
Post by: John Montenigro on December 05, 2006, 12:44:45 PM
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
Title: IPControl
Post by: dacarle on December 05, 2006, 12:49:56 PM
John-

Where abouts in New Jersey are you located?

-David
Title: IPControl
Post by: John Montenigro on December 05, 2006, 12:59:47 PM
About 20 miles west of NYC, in Essex County. Are you a neighbor?

-John
Title: IPControl
Post by: dacarle on December 05, 2006, 01:00:29 PM
I grew up in Essex County, West Orange.  Currently live in Westfield.
Title: IPControl
Post by: TechSupport on December 05, 2006, 01:34:05 PM
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.
Title: IPControl
Post by: dacarle on December 05, 2006, 01:42:45 PM
using #3

Thanks
Title: IPControl
Post by: TechSupport on December 05, 2006, 02:29:47 PM
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.

:)
Title: IPControl
Post by: John Montenigro on December 05, 2006, 03:05:24 PM
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...
Title: IPControl
Post by: TechSupport on December 05, 2006, 03:36:34 PM
John,

I also did some simple tests and it does seem like it is only the IP Control that is causing the problem (I'm keeping my fingers crossed that it is only the IP Control).

I have the fix made for the FFengine.exe. I can't upload it until I get access my to other computer later today.

(Thanks for testing those controls for me - I appreciate it)  :)
Title: IPControl
Post by: dacarle on December 05, 2006, 03:40:20 PM
John-

Always looking for consulting help.  Drop me a line at dacarle@hotmail.com if you want to discuss.

-David
Title: IPControl
Post by: TechSupport on December 05, 2006, 03:50:59 PM
David,

The TabControl icon issue is related to incorrect code generation of the icon names in the resource file. This seems to occur if you have multiple Tab Controls in your project with the same name. Try naming your second TabControl to a different name and then re-compile. I will fix this problem later on and post the fix.
Title: IPControl
Post by: dacarle on December 05, 2006, 04:22:59 PM
Thanks.

You are the man.

-David
Title: IPControl
Post by: dacarle on December 05, 2006, 04:29:22 PM
Tab control Icons working now that the control is renamed on the 2nd form.  Thanks.

Any reason, my send message is (when you remove the comment) is not updating the IPControl?

-David
Title: IPControl
Post by: John Montenigro on December 05, 2006, 06:38:41 PM
Happy to help in whatever way I can, Paul. Heaven knows how much help I've gotten from your efforts!

I if understand your latest posts correctly, you're saying that the IP control messes up the fonts when there's a Tab control in the project. However, my project does not contain any Tab controls, yet the IP control messes up the fonts.

Anything you want me to investigate?

-John
Title: IPControl
Post by: TechSupport on December 05, 2006, 09:23:46 PM
Quote from: dacarleAny reason, my send message is (when you remove the comment) is not updating the IPControl?

David,

Looks like you are forgetting to specify the %IPM_SETADDRESS message:

Here is what is in your code....

SendMessage HWND_CONFIGURELOGIN_IPCONTROL1,0,0,MakeIPFromString(N_Ctrl_1)


Here is what it should be....

SendMessage HWND_CONFIGURELOGIN_IPCONTROL1,%IPM_SETADDRESS,0,MakeIPFromString(N_Ctrl_1)
Title: IPControl
Post by: TechSupport on December 05, 2006, 09:26:18 PM
Quote from: John MontenigroI if understand your latest posts correctly, you're saying that the IP control messes up the fonts when there's a Tab control in the project. However, my project does not contain any Tab controls, yet the IP control messes up the fonts.

Hi John,

These are actually two separate issues. The font issue is with the IP Control. The "Error creating RES file" issue is related to having multiple tab controls in your project that (1) Use icons in the Tabs and, (2) Have the same "Name" property (e.g. TabControl1).
Title: IPControl
Post by: TechSupport on December 05, 2006, 10:40:21 PM
The new FFengine.exe is now ready. It should fix the Tab Control icon issue and the IP Control font issue.

http://www.planetsquires.com/files/FFengine.zip

Please let me know if you run into any trouble.
Title: IPControl
Post by: John Montenigro on December 05, 2006, 11:42:11 PM
The IP font problem is definitely gone!

Thanks, Paul!
Title: IPControl
Post by: dacarle on December 06, 2006, 11:31:35 AM
Thanks on all fronts.

My Best.

-David