June 15, 2024, 02:01:55 PM

News:

IonicWind Snippit Manager 2.xx Released!  Install it on a memory stick and take it with you!  With or without IWBasic!


ShellAboutA

Started by Jerry Muelver, March 08, 2008, 07:09:39 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Jerry Muelver

I thought I was on a roll, because I figured out how to use WritePrivateProfileStringA and GetPrivateProfileStringA by examining the .inc files. But I hit a snag when I moved on to ShellAboutA. I keep getting "no appropriate conversion exists" for this:

def appver,aboutms as pointer
def about as int
appver = NEW(char,64)
aboutms = NEW(char,64)
'ShellAboutA(HWND hWnd,pointer szApp,pointer szOtherStuff, HICON hIcon),INT
    myicon = LOADIMAGE(getstartpath + "frog-ico_1.ico",@IMGICON)
#<string>appver = "App version"
#<string>aboutms = "App designer"
about = ShellAboutA(win,appver,aboutms,myicon)

I get the same result with:
about = ShellAboutA(win,"App version","App designer",0)

Again, "no appropriate conversion". Any idea what I'm missing?

LarryMc

plug win.hwnd  in place of just win

HWND hWnd is actually telling you a variable called hWnd of EBasic type uint

win is actually a EBasic structure

win.hwnd in an element of win of type uint which is the handle to the window

Larry
LarryMc
Larry McCaughn :)
Author of IWB+, Custom Button Designer library, Custom Chart Designer library, Snippet Manager, IWGrid control library, LM_Image control library

Jerry Muelver

Well, THAT's a good lesson! Thanks, Larry!

I thought "hwnd" in the declaration was just a stand-in notation for "window handle", which "win" already was. I just lucked out on "HICON hicon", I guess. Tricky stuff, these "inc" files.

What about the "DWORD" mentioned in some declarations? Like:
GetPrivateProfileStringA(LPCSTR lpAppName, LPCSTR lpKeyName, LPCSTR lpDefault,LPSTR lpReturnedString,DWORD nSize, LPCSTR lpFileName),DWORD

I handled that with an INT, like "retInt = GetPrivateProfile..." and it works. I also used an INT for nSize. Can I get by with using INT when a DWORD is called for? I also use INT for BOOLEAN. Makes me think I'm talking slang when everyone else is being formal.

pistol350

March 09, 2008, 06:17:51 AM #3 Last Edit: March 09, 2008, 06:20:11 AM by pistol350
Hi Jerry!

in case you would want to keep any initial variable Types used by the API functions you can create aliases with TYPEDEF command.

from user guide :
Quote
Creating aliases for variable types with TYPEDEF

The TYPEDEF (type define) statement allows referring to a built in variable type by a different name. This can aid in code readability and conversion of source code from other languages. For example some common variable types found in C are 'byte', 'bool', 'HANDLE', etc. which are themselves aliases for an unsigned character, integer and unsigned integer.  These type names can be duplicated in EBASIC using the following statements:

TYPEDEF byte CHAR
TYPEDEF bool INT
TYPEDEF HANDLE UINT

You can also use a previous type define to create a new one as in:

TYPEDEF HWND HANDLE

Once a variable type has been aliased with TYPEDEF it can be used in place of the actual type.

DEF bDone as bool
DEF hWnd as HWND


About DWORD type, yes i think a INT or UINT can be a good replacement.
I sometimes check the WindowsTypes.inc header that you can find here : http://www.ionicwind.com/forums/index.php/topic,824.0.html

Forgot to mention that this file is a Aurora header.
Regards,

Peter B.

Jerry Muelver

Thanks, Peter. I'm starting to get a glimmer of what the DECLAREs are all about. Now all I have to do is figure out how to find the API calls for the stuff I want have happen. I can pick some of it out from the routine names, and I suppose much of the rest from MSDN and MSDN2 pages that show up on Google searches. That's been working, so far, but it would be nice to have a richly-detailed catalog listing of all this stuff.

Oh.... I see. That's what MSDN really IS! I get it....  ::)