NO

Author Topic: Hyperlink Custom control.  (Read 6565 times)

nitex

  • Guest
Hyperlink Custom control.
« on: April 18, 2005, 09:50:01 PM »
This is my new hyperlink custom control, which can be used directly from the dialog editor.

Copy the compiled hyperlink.dll somewhere into Pelles C folder.

Open the dialog editor and select from the dialog menu, open custom control and choose the hyperlink.dll.

To use it in your projects call either:

Code: [Select]
LoadLibrary(_T("hyperlink.dll"));

in your startup code. The hyperlink.dll needs to be in your projects folder and redistributed with your setup.

Or copy hyperlink.h and hyperlink.c into your projects folder, include hyperlink.h and call:

Code: [Select]
Hyperlink_RegisterClass();

in your startup code. No DLL needs to be redistributed.

Have a look at hyperlink.h for the supported functions.


Greets, Alex

Anonymous

  • Guest
Hyperlink Custom control.
« Reply #1 on: April 18, 2005, 10:13:06 PM »
very interesting...

Offline Pelle

  • Administrator
  • Member
  • *****
  • Posts: 2266
    • http://www.smorgasbordet.com
Hyperlink Custom control.
« Reply #2 on: April 18, 2005, 11:11:00 PM »
Nice! Well done! :-)

Pelle
/Pelle

czerny

  • Guest
Re: Hyperlink Custom control.
« Reply #3 on: August 04, 2014, 02:23:33 PM »
Is there any documentation about the usage of custcntl.h?
How is the resource editor talking to an custom control dll?

All I have found is to Borlands resource workshop.

czerny

  • Guest
Re: Hyperlink Custom control.
« Reply #4 on: August 05, 2014, 01:23:41 PM »
I will try to summarize what I have found so far!

The following functions have to be provided and exported by the dll:

typedef UINT (CALLBACK* LPFNCCINFO)(LPCCINFO acci);
typedef BOOL (CALLBACK* LPFNCCSTYLE)(HWND hwndParent,  LPCCSTYLE pccs);
typedef INT (CALLBACK* LPFNCCSIZETOTEXT)(DWORD flStyle, DWORD flExtStyle, HFONT hfont, LPSTR pszText);

The first one has to be exported by name (ordinal does not matter). The CCINFO structure has pointer entrys for the two other functions. The name of each function does not matter. So it is not clear to me how the resource editor knows it.

The Resource Workshop expects a fourth function 'listclasses()', which should be exported by name. The name matters here! But this function seems to be a Borland special.

The return values of the
Info() seems to return the number of controls in the dll: 0 .. n
Style() returns the exit status of the style dialog: TRUE|FALSE
SizeToText() returns the size of the control text in pixels or -1 if error

I am not sure with the last one!

How is the CCSTYLEFLAG array terminated? There is no size or number provided for this. Has it to be NULL-terminated some how?

Who has to build the style dialog, resource editor (using the CCSTYLE structure) or the programmer of the dll?

There are other questions, but I will stop here.
« Last Edit: August 05, 2014, 01:36:10 PM by czerny »

Offline frankie

  • Global Moderator
  • Member
  • *****
  • Posts: 2096
Re: Hyperlink Custom control.
« Reply #5 on: August 06, 2014, 02:40:49 PM »
What I understood is that the interface is the same used by VC8 dialog editor,
Some info can be taken from the original custcntl.h.
A sample of use is custcntl.c.
All required info for the custom control is passed in the CCINFO structure available from exported function 'CustomControlInfoA'.
It is better to be hated for what you are than to be loved for what you are not. - Andre Gide

czerny

  • Guest
Re: Hyperlink Custom control.
« Reply #6 on: August 07, 2014, 12:17:03 PM »
What I understood is that the interface is the same used by VC8 dialog editor, ...

You guess or you understand?

A sample of use is custcntl.c.

There was a person some time ago, who asked about source code for a resource editor. I don't remember who it was. The above project 'DLGEDIT' could be of interesst for him. It shows the whole thing from the resource editor point of view.

Offline frankie

  • Global Moderator
  • Member
  • *****
  • Posts: 2096
Re: Hyperlink Custom control.
« Reply #7 on: August 07, 2014, 04:00:48 PM »
What I understood is that the interface is the same used by VC8 dialog editor, ...

You guess or you understand?

? ? ? ? ?  :(

Check 'SpinCube' sample in WIN7 SDK @ 'Microsoft SDKs\Windows\v7.1\Samples\winui\controls\custom\spincube'
It is better to be hated for what you are than to be loved for what you are not. - Andre Gide