ďťż

Ładny brzuch

Hej,

Mam program, który kompilował się na BCB6, natomiast jest problem z BCB 2006, wyświetla się ten błąd:

[C++ Error] main.cpp(1186): E2285 Could not find a match for 'TEvent::TEvent(int,bool,bool,char *)'

TEvent *Ev = new TEvent(NULL, true, false, ""); - a tak wygląda linijka kodu, która sprawia problem. Czyżbym musiał dołączyć jakiś plik nagłówkowy?



Daj zamiast NULL, 0, tak mysle ;-)

// edit
http://discuss.techi...ign.4.195262.19

NULL is *always* defined as 0, even on machines where 0 is a valid memory address which could be returned by malloc(). NULL and 0 are completely 100% interchangable. This is garanteed by the standards.
Dobrze, chociaz sie czegos dowiedzialem ;-p
Użytkownik krajew4 edytował ten post 13 marzec 2007, 22:17

Daj zamiast NULL, 0, tak mysle ;-)
hmmmm
a to nie to samo?


Daj zamiast NULL, 0, tak mysle ;-)

:lol2:



jak wyglada konstruktor klasy TEvent? byc moze sie zmienil i podajesz nieprawidlowe parametry, dlatego kompilator nie moze znalezc odpowiedniej wersji konstruktora

W pomocy BCB2006 znalazłem taką informacje:


Class
TEvent

Syntax

[Delphi]constructor Create(EventAttributes: PSecurityAttributes; ManualReset: Boolean; InitialState: Boolean; const Name: string; UseCOMWait: Boolean);

Description
Call Create to create a TEvent object. Create can generate a new event object or can provide access to an existing named event object.

Set the EventAttributes parameter to specify the access rights and inheritance capabilities of the new event object. Calling Create with EventAttributes set to nil (Delphi) or NULL (C++) creates an event object with a default set of security attributes. If the TEvent object is created to access an existing named event object, only the bInheritHandle field of EventAttributes is used, as the access rights were determined when the event object was created.

Set ManualReset to specify whether the signal of the TEvent object can only be turned off by a call to the ResetEvent method, or whether it is automatically reset when a single waiting thread is released. When ManualReset is true, the TEvent signal stays set until the ResetEvent method turns it off. When ManualReset is false, the signal is automatically turned off when only a single thread waits on the signal and that thread is released. If the TEvent object is created to access an existing named event object, the ManualReset parameter is ignored.

Set InitialState to indicate whether the TEvent object should be created with the signal set, or turned off. When InitialState is true, the TEvent object is created with the signal set. If the TEvent object is created to access an existing named event object, the InitialState parameter is ignored.

Set Name to provide a name for a new event object or to specify an existing named event object. If no other thread or process will need to access the event object to wait for its signal, Name can be left blank. Name can be a string of up to 260 characters, not including the backslash character (\). If Name is used to specify an existing event object, the value must match the name of the existing event in a case-sensitive comparison. If Name matches the name of an existing semaphore, mutex, or file-mapping object, the TEvent object will be created with Handle set to 0 and all method calls will fail.



W pomocy BCB2006 znalazłem taką informacje:
Cieszymy sie wielce ze znalazles ta informacje. Masz jakies pytania, czy chciales sie tylko pochwalic ze znalazles? A moze nie zauwazyles jeszcze ze konstruktor wydaje sie byc inny niz Twoje wywolanie?

  • zanotowane.pl
  • doc.pisz.pl
  • pdf.pisz.pl
  • zsf.htw.pl
  •