c++ problems

This forum is designated to discuss SiComponents Scheduling Agent.
petrossa
Posts: 23
Joined: Tue Aug 12, 2008 6:38 pm

Post by petrossa »

The Boundary Exception occurs when this function is called.

FInterface := itf.RegisterTaskDefinition(CollapseName(FTaskName),
FTaskDefinition, TASK_CREATE_OR_UPDATE, s, s,
FTaskDefinition.Principal.LogonType, s);

see www.petrossa.com/screenshot.jpg for output

It only occurs in Vista

(Detail: The application is called TaskExplorer, why it becomes TaskEplorer :?: )
isiticov
Site Admin
Posts: 2383
Joined: Thu Nov 21, 2002 3:17 pm

Post by isiticov »

This is very strange and we can't catch this behavior. I think this message (it is directly from Vista's scheduler) appears only when using some particular settings. Could you send us a sample project that always reproduces this error?
Best regards,
Igor Siticov.
petrossa
Posts: 23
Joined: Tue Aug 12, 2008 6:38 pm

Post by petrossa »

www.petrossa.com/sample.rar

when tracing into the function i end up in the in the system lib. As its the c++ inmplementation it jumps to the ASM section. The exception occurs after this sequence

procedure _LStrArrayClr(var StrArray; cnt: longint); (seems to work)
procedure _WStrClr(var S); (causes the exception)

on copying the parameters to the taskschedulerfunction. If i counted right its the 3rd or 4th parameter

ps

i just leave all settings at default, and give only the taskname.
tried filling out all fields no diff
isiticov
Site Admin
Posts: 2383
Joined: Thu Nov 21, 2002 3:17 pm

Post by isiticov »

I'm sorry, but we don't need EXE sample as we can't debug it. We need source sample to see what code causes that error message and try to debug it. Also, as you see the error comes from system DLL and could be a bug in Vista's Scheduler itself.
Best regards,
Igor Siticov.
petrossa
Posts: 23
Joined: Tue Aug 12, 2008 6:38 pm

Post by petrossa »

yes i quessed as much, but the present source depends on 3rd party vcl components so i cant give it.

I just hoped it meant something to you, because read i the tasksched doc the there is a StartBoundary defined in the vista taskscheduler
http://msdn.microsoft.com/en-us/library ... S.85).aspx

Could it be that there's ghost info in the buffer? Should i start looking in the trigger source? Can you give a quick codefragmednt which zeros the trigger data buffer?

Anyway there's a memory overwrite somewhere which causes the application name to miss a letter, i double checked but the Application.Title property does give false info.
petrossa
Posts: 23
Joined: Tue Aug 12, 2008 6:38 pm

Post by petrossa »

it's that bothersome person again...

Could this be a cause?
http://www.inter-locale.com/whitepaper/ ... kbook.html

the exception goes as follows:

when defining a task and you choose from the dropdowncombobox the schedule, choosing:

Once only, gives (7,8)Startboundary:.
Daily, gives (10,8)Startboundary:.
Weekly, gives (11,8)Startboundary:.
Monthly, gives (24,8)Startboundary:.

all other choices throw no exceptions, and the wizard finishes normally.
isiticov
Site Admin
Posts: 2383
Joined: Thu Nov 21, 2002 3:17 pm

Post by isiticov »

Are you able to reproduce this when using Quick Demos from the Demo project? There is item named "Run notepad.exe every day at 09:00" which creates daily task. We've tested this on our side and it works just fine.
Best regards,
Igor Siticov.
petrossa
Posts: 23
Joined: Tue Aug 12, 2008 6:38 pm

Post by petrossa »

tnx for your efforts, i appreciate them. I can only quess there's some weird interaction that takes place between different VCL's.

I use also LMD-tools v7 and it seems theres some 'i dont know what' which interacts when compiling the taskwizard.pas in a c++ project.

I also build your delphidemo (ofcourse) and it works perfectly. So i gave up and i am rewriting the createtask wizard from ground up in C.

I did notice however that in a c++ project in need to include satask.pas and sautils.pas in the project to prevent linker errors.

The c++ project to build the component omits IsUserAdmin and CreateTaskDefinition.

But your component is ok, thats for sure.
petrossa
Posts: 23
Joined: Tue Aug 12, 2008 6:38 pm

Post by petrossa »

Can't get rid of the startboundary exception. I finally managed to trap the errorcode, it's

SCHED_E_MISSINGNODE
0x80041319
The task XML is missing a required element or attribute.

Can you point me in the direction where to fix this? Perhaps you know this immediately whilst i have to read the entire docs.....

(the File not Found exception was caused by not setting VistaSelectedFolder btw)

UPDATE:

Found it. Even when you set TriggerType to ttOnce you have to zero the TriggerDetails....

According to the docs it shouldn't matter, but now i got it running without exceptions.
Post Reply