Avatar of EwS
 asked on


I need to call CeCreateProcess FROM THE DESKTOP.
My code doesn't work, I can't find any working examples.

I declare CeCreateProcess as follows:

Private Declare Function CeCreateProcess Lib "rapi.dll" _
(ByVal lpApplicationName As String, ByVal lpCommandLine As String, _
ByVal lpProcessAttributes As Long, ByVal lpThreadAttributes As Long, _
ByVal bInheritHandles As Long, ByVal dwCreationFlags As Long, _
ByVal lpEnvironment As Long, ByVal lpCurrentDirectory As Long, _
ByVal lpStartupInfo As Long, ByVal lpProcessInformation As Long) As Long

When I call the function, I get error 2 (The system cannot find the file specified):
ret = CeCreateProcess("peghelp.exe", "file:test.htm#one", 0, 0, 0, 0, 0, 0, 0, 0)

When I call the function from my eVB program, it works fine (the only thing I have to change is "rapi.dll" in the Declare Function statement to "coredll").

Can you, please, tell me what I'm doing wrong or possibly give me an example that works? Thank you.
Visual Basic Classic

Avatar of undefined
Last Comment

8/22/2022 - Mon

I found a solution to my problem. The strings that I'm passing to CeCreateProcess need to be in unicode:

ret = CeCreateProcess(StrConv("peghelp.exe", vbUnicode), StrConv("file:test.htm#one", vbUnicode), 0, 0, 0, 0, 0, 0, 0, 0)

It works.

Hi EwS,
Experts-Exchange is performing an automated process to delete old questions.  There have been no responses to this question, so it will be DELETED within 3 days.

Your points will be refunded.

If you still need the answer to this question, you should ask it again, as a new question.  Your new question will appear at the top of the list, where many Experts will see it and respond.  Here are some general tips on getting Experts to work on your questions:
1) Offer a high point level.  Experts often concentrate on higher-valued questions.
2) Choose the best Topic Area -- target the experts who have the specific skills that you need.
3) Include keywords in the Question Title that will attract the right Experts.
4) Provide FULL DETAILS in the question body so the Experts can get right to work on a solution.
5) When an Expert does make a comment, be sure to be responsive.

For more information on Asking Questions, see http://www.cityofangels.com/Experts/Member.htm
For information on how to finalize questions, see: http://www.cityofangels.com/Experts/Closing.htm
Please DO NOT respond to this automated post.  DO NOT ACCEPT THIS COMMENT AS AN ANSWER.  Thank you for participating at Experts-Exchange.

CleanupGuy -- EE database cleanup volunteer

View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
Ask your own question & get feedback from real experts
Find out why thousands trust the EE community with their toughest problems.
Experts Exchange has (a) saved my job multiple times, (b) saved me hours, days, and even weeks of work, and often (c) makes me look like a superhero! This place is MAGIC!
Walt Forbes