Santosh Nandi wrote: > 1.Is there any solution where a structure needs to be passed in a DLL Call.As far as I know Avenue does not support this datatype.
When faced with DLL structures that contain data types not supported by the calling program, you can always fake them with data types you can support. For example, suppose you encountered a structure like so: ... size as BYTE name as LPSTR ...
I don't know Avenue, but I bet you can support the LPSTR as a plain String type. But suppose you didn't have an eight-bit byte data type to substitute for BYTE. In that case, use a short integer, like so (using MapBasic types): ... size as SmallInt name as String ...
To handle this structure, you need to know that the data that represents the BYTE goes in the low-order half of 'size', the first character of the string is in the high-order byte of 'size' and the rest of the string is in 'name'. To write the value 14 into size and "Arial" into name, you use the following formula for 'size'. size = Asc("A") * 256 + 14 and then set name like so: name = "rial"
Put these in your structure and as far as the DLL is concerned, all the data elements are in the right place.
To read these values back, you can do it this way: name = Chr$(sizeŽ) & name size = size mod 256
Note the integer divide '' as opposed to the normal division operator '/'. The trick is using integers to take the place of bytes. When passed between caller and API, they're all just bits in memory anyway: all you have to do is arrange them in the right order.
> 2. I want to change my screen resolution through Avenue.What arguments should I pass to the DLL Call "Change Display Settings"
My guess is that you want SetGraphicsMode(). You need to get a handle to the device context first (GetDC()), and I think you need to also need to do something with ModifyWorldTransform(). Also don't forget to call ReleaseDC() when you're done. If you don't have the API Bible by Dan Appleton or something comparable, then you'll need to search places like http://www.ezvb.com/ for the details.
-- - Bill Thoen ------------------------------------------------------------ GISnet, 1401 Walnut St., Suite C, Boulder, CO 80302 tel: 303-786-9961, fax: 303-443-4856 mailto:bthoen@gisnet.com, http://www.gisnet.com/ ------------------------------------------------------------
To unsubscribe, write to gislist-unsubscribe@geocomm.com ________________________________________________________________________ Setup a GeoCommunity Account and have access to FAST DataDownloads and Premium Career Posting at a discounted rate! https://www.geocomm.com/cgi-bin/accounts/login
On-line Archives available at http://spatialnews.geocomm.com/community/lists/
|