forum.vdsworld.com Forum Index forum.vdsworld.com
Visit VDSWORLD.com
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 


Create Event log entries?

 
Post new topic   Reply to topic    forum.vdsworld.com Forum Index -> Wish List
View previous topic :: View next topic  
Author Message
Sanjuro
Contributor
Contributor


Joined: 01 May 2003
Posts: 59
Location: Norfolk-United Kingdom

PostPosted: Mon Sep 08, 2003 4:15 pm    Post subject: Create Event log entries? Reply with quote

I would like the ability to create an entry in the event log/eventvwr fror my apps. Something along the lines of :

EVENT CREATE,<SECTION>,<TYPE>,<SOURCE>,<CATEGORY>,<ID>,<MESSAGE>

E.g.

EVENT CREATE, APPLICATION, Warning, SanjuroAPP, (4), 1001, SanjuroApp has closed because it failed to find the file %%FILE at the location %%LOC.

I know that their are 3rd party command line apps that will do this for me but inside VDS is better Smile

Sanjuro

_________________
"Apparently three out of four people make up 75 percent of the population. Smile
Back to top
View user's profile Send private message MSN Messenger
CodeScript
Moderator Team


Joined: 08 Jun 2003
Posts: 1060
Location: India

PostPosted: Wed Sep 10, 2003 5:20 pm    Post subject: Reply with quote

I think you need an API called ReportEvent among others which requires 9 parameters in @LIB() function. As far as I know VDS supports only 8 parameters in any near foreseeable future Crying So it is not possible in pure VDS. You may consider using external DLL's/gadget if U want or stick to the command line app.
_________________
Regards
- CodeScript
Arrow Give your application a professional look with the VDSGUI Extension
Back to top
View user's profile Send private message Visit poster's website
vdsalchemist
Admin Team


Joined: 23 Oct 2001
Posts: 1448
Location: Florida, USA

PostPosted: Wed Sep 10, 2003 7:28 pm    Post subject: Reply with quote

CodeScript wrote:
I think you need an API called ReportEvent among others which requires 9 parameters in @LIB() function. As far as I know VDS supports only 8 parameters in any near foreseeable future Crying So it is not possible in pure VDS. You may consider using external DLL's/gadget if U want or stick to the command line app.


Well Actually CodeScript there is a way to get around this limitation but I was not going to say anything Twisted Evil Anyway what you would have to do is this.
Code:
LoadLib advapi32.dll
%A = @binary(word,%%fwEventType)@binary(word,%%fwCategory)
%%Ret = @lib(advapi32,ReportEvent,BOOL:,%%EventHandle,%A,%%IDEvent,%%pUserSid,%%cStrings,%%cbData,STR:%%plpszStrings,%%pvData)


The code above my not work depending on how VDS pushes the parameters onto the call stack for the functions. Usually you can combine parameters into a structure and pass the value of the structure to the function. In windows functions read the stack and pull the parameters off of the stack according to the variable type of the parameter so combining parameters into a structure should not matter.

_________________
Home of

Give VDS a new purpose!
Back to top
View user's profile Send private message Visit poster's website AIM Address Yahoo Messenger MSN Messenger
CodeScript
Moderator Team


Joined: 08 Jun 2003
Posts: 1060
Location: India

PostPosted: Thu Sep 11, 2003 2:31 am    Post subject: Reply with quote

Thanks mindpower for the suggestion.
I had tried similar trick earlier with an API. It said invalid parameters Sad sometimes and sometimes the IDE just crashed. I have to try in this case though what happens.

_________________
Regards
- CodeScript
Arrow Give your application a professional look with the VDSGUI Extension
Back to top
View user's profile Send private message Visit poster's website
CodeScript
Moderator Team


Joined: 08 Jun 2003
Posts: 1060
Location: India

PostPosted: Thu Sep 11, 2003 9:58 am    Post subject: Reply with quote

No It doesn't work Sad and sometimes the app appears to go crazy. I think the whole heap gets corrupted or something.
GetLastError gives 998 == Invalid access to memory location. The same thing occured with previous attempts with some other API.
mindpower did U get it working with any APIs. If so please let me know I will give that a try.

Also I am waiting for the VDS update which is going to increase the parameter limit to 12 as Jules said.

_________________
Regards
- CodeScript
Arrow Give your application a professional look with the VDSGUI Extension
Back to top
View user's profile Send private message Visit poster's website
Dr. Dread
Professional Member
Professional Member


Joined: 03 Aug 2001
Posts: 1065
Location: Copenhagen, Denmark

PostPosted: Thu Sep 11, 2003 11:11 am    Post subject: Reply with quote

.. or give Mac's VDSUG.dll a go - it supports up to 20 parameters when calling non-VDS DLLs.

More info here: http://forum.vdsworld.com/viewtopic.php?t=2002

Greetz
Dr. Dread

_________________
~~ Alcohol and calculus don't mix... Don't drink and derive! ~~

String.DLL * advanced string processing
Back to top
View user's profile Send private message
vdsalchemist
Admin Team


Joined: 23 Oct 2001
Posts: 1448
Location: Florida, USA

PostPosted: Thu Sep 11, 2003 3:05 pm    Post subject: Reply with quote

CodeScript wrote:
No It doesn't work Sad and sometimes the app appears to go crazy. I think the whole heap gets corrupted or something.
GetLastError gives 998 == Invalid access to memory location. The same thing occured with previous attempts with some other API.
mindpower did U get it working with any APIs. If so please let me know I will give that a try.


I have not tried this CodeScript. I was afraid of the heap being corrupted. I guess you can't do this little trick with VDS then.

_________________
Home of

Give VDS a new purpose!
Back to top
View user's profile Send private message Visit poster's website AIM Address Yahoo Messenger MSN Messenger
CodeScript
Moderator Team


Joined: 08 Jun 2003
Posts: 1060
Location: India

PostPosted: Thu Sep 11, 2003 7:23 pm    Post subject: Reply with quote

Dr. Dread wrote:
.. or give Mac's VDSUG.dll a go - it supports up to 20 parameters when calling non-VDS DLLs.
Greetz
Dr. Dread

Yeah but this one requires passing parameters by ref I have to try.

Any way :
I have written a sample code. This should hopefully work after the VDS update
http://codescript.vdsworld.com/VDS5src/NTeventlog.zip

_________________
Regards
- CodeScript
Arrow Give your application a professional look with the VDSGUI Extension
Back to top
View user's profile Send private message Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic    forum.vdsworld.com Forum Index -> Wish List All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You can attach files in this forum
You can download files in this forum

Twitter@vdsworld       RSS

Powered by phpBB © 2001, 2005 phpBB Group