473,396 Members | 2,024 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

How to write a Declare for a sub?

How to write a Declare for a sub? For example:void CoTaskMemFree(
void * pv
);Strict On does not like:Public Declare Function CoTaskMemFree Lib "ole32"
(ByVal hMem As IntPtr)because it has no "As clause"Thanks
Dec 29 '05 #1
2 1230
" **Developer**" <RE*************@a-znet.com> ha scritto nel messaggio
news:#C*************@TK2MSFTNGP15.phx.gbl...
How to write a Declare for a sub? For example:void CoTaskMemFree(
void * pv
);Strict On does not like:Public Declare Function CoTaskMemFree Lib "ole32" (ByVal hMem As IntPtr)because it has no "As clause"Thanks


Sure!
A function must have a return type.
Use Sub instead.
--
- Free .Net Reporting tool
http://www.neodatatype.net
Dec 29 '05 #2
What can I say?
I've done Declares many many times and always it was Function (and I used to
write C) so I never occurred to me - oh well!

Thanks

"Zanna" <zn*******@virgilio.it> wrote in message
news:43**********************@reader4.news.tin.it. ..
" **Developer**" <RE*************@a-znet.com> ha scritto nel messaggio
news:#C*************@TK2MSFTNGP15.phx.gbl...
How to write a Declare for a sub? For example:void CoTaskMemFree(
void * pv
);Strict On does not like:Public Declare Function CoTaskMemFree Lib

"ole32"
(ByVal hMem As IntPtr)because it has no "As clause"Thanks


Sure!
A function must have a return type.
Use Sub instead.
--
- Free .Net Reporting tool
http://www.neodatatype.net

Dec 29 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: Evgeny Gopengauz | last post by:
"Do something for each row of the query" The only way I know is: --- declare @C cursor set @C= cursor for select F from T where ... declare @F int open @C while 0=0 begin
1
by: Bill | last post by:
Is there a way to combine the use of a web form and the Response.Write method? I am creating a search page with 1000's of results. The results are to large to buffer so I want to use the...
2
by: cagey cretin | last post by:
I have set up a catch/try deal to find an error, but there are none reported nor when I clean the build/rebuild. Simple filecalled text_file.txt. I cannot write to it, but I can write into it with...
3
by: יניב | last post by:
how could i write this into a sting : strXML = "<?xml version='1.0'?>\n"; thanks
4
by: Seok Bee | last post by:
Dear Experts, I have created a script to extract the Event Logs from the system into an excel sheet. The logs are separated into 2 worksheets (Application Log and System Log). After this excel...
3
by: XJ | last post by:
Hi experts, i try to use vb.net 2005 call dll, then give me "Attempted to read or write protected memory.This is often an indication that other memory is corrupt". i have chk some message others...
1
by: ianyian | last post by:
Hi experts, i try to use vb.net 2005 call C++ dll, then give me "Attempted to read or write protected memory.This is often an indication that other memory is corrupt". i have chk some message...
4
by: Adrian Wallis | last post by:
Hello, I'm trying to call LsaOpenPolicy, but get the error 'System.AccessViolationException'. I originally tried a conversion from working VB6 code and I've compared the code with working C#...
1
by: rafaelcho | last post by:
Hello I am new to group, and new to development. I have question. I am doing project on embedded, need to read/write to the registers of the microprocessor. Two questions: 1. How to declare?...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.