Solved

Dupelicate Instantces

Posted on 2000-04-05
10
142 Views
Last Modified: 2010-04-04
How do I check my program for duplicate instantaces??? Thanks!
0
Comment
Question by:nafa2221
10 Comments
 
LVL 13

Accepted Solution

by:
Epsylon earned 50 total points
ID: 2688152
On this page you can see how to do that:

http://www.gnomehome.demon.nl/uddf/pages/api.htm#api0
0
 

Author Comment

by:nafa2221
ID: 2688676
that was somewhat confusing, can u post an example and where I would post the code, also can u tell me howto get to the area I am supposed to post my code? Thanks!!!
0
 
LVL 27

Expert Comment

by:kretzschmar
ID: 2688770
hi nafa2221,

a simple method
(modification in the dpr-file)

program itTimer;

uses
  windows,
  Forms,
  Dialogs,
  itGlobal in 'itGlobal.pas',
  ufrmTIMER in 'ufrmTIMER.pas' {frmTIMER},
  doitAPI in 'doitAPI.pas',
  ufrmTIMERUpdate in 'ufrmTIMERUpdate.pas' {frmTimerUpdate},
  ufrmTIMERShow in 'ufrmTIMERShow.pas' {frmTimerShow},
  ufrmTimerSub in 'ufrmTimerSub.pas' {frmTimerSub},
  ufrmErrorReport in 'ufrmErrorReport.pas' {frmErrorReport},
  ufrmprobtimer in 'ufrmprobtimer.pas' {frmProblemeTimer};

{$R *.RES}

var StartUpH : THandle;

begin
  StartUpH := FindWindow(PChar('TfrmTIMER'),PChar('inTIME · Timer'));
  if (StartUpH <> 0) and (ParamStr(1) <> 'Test') then  //no testenviroment
  begin
//    ShowWindow(StartUpH,SW_SHOW);
    MessageDlg('itTimer ist bereits gestartet!',mtInformation,[mbOK],-1);
  end
  else
  begin
    Application.Initialize;
    Application.Title := 'inTIME · Timer';
    Application.CreateForm(TfrmTIMER, frmTIMER);
  Application.CreateForm(TfrmTimerUpdate, frmTimerUpdate);
  Application.Run;
  end;
end.

meikl
0
 
LVL 1

Expert Comment

by:fulvio_brasil
ID: 2688776
Try this (put the code in .DPR file)

var Handle1: HWND;

begin
  Application.Initialize;
  Handle1 := FindWindow('TfrmMain','Caption');
  if (Handle1 = 0) then begin
    Application.CreateForm(TfrmMain, frmMain);
    ...
    Application.Run;
  end
  else
    ShowMessage('App already running!');
end.

Obs: 'TfrmMain' = Class of Main Form
     'Caption' = Caption on Main Form

cheers,

Fulvio.
0
 
LVL 13

Expert Comment

by:Epsylon
ID: 2688788
Fulvio, would you mind to withdraw your answer since other solutions have been given before you...?
0
How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

 
LVL 1

Expert Comment

by:fulvio_brasil
ID: 2690289
No problem Epsylon!

What happend was when I posted it I didn't see the other solution (just 3 min. before)

See you,

F.
0
 
LVL 13

Expert Comment

by:Epsylon
ID: 2690340
Yup, I see   :o)
0
 
LVL 1

Expert Comment

by:fulvio_brasil
ID: 2692099
Hi Epsylon, please, could you answer me why a lot of people offers the answer like a comment, what's the advantage?
And about the point? How they won the points?

I'm new in the site and never understood it :o)

Thanks in advance,

Fulvio.
0
 
LVL 13

Expert Comment

by:Epsylon
ID: 2697569
Fulvio, when you're sure that the answer is correct AND your're the first one then you could submit it as answer. But when someone else has already given a (partial) solution, submit it as comment. This is an unwritten(?) rule here at EE...
0
 
LVL 1

Expert Comment

by:fulvio_brasil
ID: 2698956
Thanks Epsylon! :o)
0

Featured Post

Do You Know the 4 Main Threat Actor Types?

Do you know the main threat actor types? Most attackers fall into one of four categories, each with their own favored tactics, techniques, and procedures.

Join & Write a Comment

Suggested Solutions

The uses clause is one of those things that just tends to grow and grow. Most of the time this is in the main form, as it's from this form that all others are called. If you have a big application (including many forms), the uses clause in the in…
Creating an auto free TStringList The TStringList is a basic and frequently used object in Delphi. On many occasions, you may want to create a temporary list, process some items in the list and be done with the list. In such cases, you have to…
When you create an app prototype with Adobe XD, you can insert system screens -- sharing or Control Center, for example -- with just a few clicks. This video shows you how. You can take the full course on Experts Exchange at http://bit.ly/XDcourse.
This video explains how to create simple products associated to Magento configurable product and offers fast way of their generation with Store Manager for Magento tool.

705 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now