|
Timers looks much more appropriate for doing that !! With the Sleep, your application will freeze (and thus not respond to user commands) during the Sleep time... In general, the use of Sleep is usefull for some very specific cases...
|
|
|
|
|
Yes, like telling your app that it's time to do something.
|
|
|
|
|
Hallo,
i try with VisualC++ 6 to read the LDAP user list, but all the examples didn't work.
See the problem:
--------------------Konfiguration: Test5 - Win32 Debug--------------------<br />
Kompilierung läuft...<br />
Test5.cpp<br />
d:\program files\microsoft visual studio\vc98\include\iads.h(27) : error C2146:<br />
Syntaxfehler : Fehlendes ';' vor Bezeichner 'IADs'<br />
(Syntax error: missing ';' befor identifier 'IADs') <br />
d:\program files\microsoft visual studio\vc98\include\iads.h(27) : fatal error C1004:<br />
Unerwartetes Dateiende gefunden<br />
(unexpected file end found)<br />
Fehler beim Ausführen von cl.exe.<br />
<br />
Test5.exe - 2 Fehler, 0 Warnung(en)<br />
In the iads.h(27) you find this: "typedef interface IADs IADs;".
I think i forgot a compiler directive or a lib file, but i didn't find information in the tutorials and forums.
Thanks in advance!
Carl
|
|
|
|
|
I noticed one sample included this file as well:
#include <activeds.h>
Does that help at all?
|
|
|
|
|
Not real,
I know the samples on this pages and also on MSDN. From this i built this example:
<br />
#include "stdafx.h"<br />
#include <afxwin.h><br />
#include <activeds.h><br />
#include <Adshlp.h><br />
#include <iads.h><br />
<br />
int main(int argc, char* argv[])<br />
{<br />
HRESULT hr;<br />
IADS *pads;<br />
<br />
hr = ADsGetObject( L"LDAP://rootDSE", IID_IADs, (void**)&pads);<br />
return 0;<br />
}<br />
I know the main function didn't real work, but it is enough for a build, i think.
|
|
|
|
|
I also saw this in MSDN:
Library: Included as a resource in Activeds.dll.
GUID: IID_IADs is defined as FD8256D0-FD15-11CE-ABC4-02608C9E7553.
Which makes me think you need to import the ActiveDS.Dll into your project to get the interface library.
See about the #import directive:
The #import directive is used to incorporate information from a type library. The content of the type library is converted into C++ classes, mostly describing the COM interfaces.
|
|
|
|
|
That's right, i saw it to. And i tried it yesterday again, with normal '#import <activeds.dll>' (also with ") you get this error message:
--------------------Konfiguration: Test5 - Win32 Debug--------------------<br />
Kompilierung läuft...<br />
Test5.cpp<br />
d:\daten\projekte\teamscrip\c++\test5\test5.cpp(4) : fatal error C1083: Typbibliothek-Datei kann nicht geöffnet werden: 'activeds.dll': Fehler beim Laden der Typbibliothek/DLL.<br />
Fehler beim Ausführen von cl.exe.<br />
<br />
Test5.exe - 1 Fehler, 0 Warnung(en)<br />
the compiler wasn't able to load the dll.
|
|
|
|
|
I am really out of ideas, so anything at this point is going to be trial and error
MS says the 'interface library' is embedded within the DLL. Normally you would use the #import directive to get at that, and it does not currently work ...
Perhaps, try running RegServer on the Dll and see if it will show up as an ActiveX or else at least allow you to #import after doing that. Maybe it is not 'registered' yet?
Maybe there needs to be a TLB generation run against the DLL so you can include the type library in your project instead of importing the DLL directly.
Another thing I found on MDSN was this - (assume it is an ActiveX control for a moment..)
The following procedure adds dispatch class and header files for an ActiveX control to a Visual C++ project.
To add an ActiveX control to a Visual C++ Project:
On the Project menu, click Add to Project. A shortcut menu appears.
Click Components and Controls. The Components and Controls Gallery dialog box appears.
Click the component to add to your project. Visual C++ displays a dialog box from which you can select a subset of the component's classes to add to your project.
Click to select the check boxes of the classes you want to add, and click OK.
Visual C++ generates dispatch class and header files for the component and adds them to your project.
|
|
|
|
|
Okay, I think I got it...
1. Go to the stdafx.h and REMOVE the following line:
<br />
#define WIN32_LEAN_AND_MEAN // Exclude rarely-used stuff from Windows headers<br />
Once I did this, I did not get the error from the IAds.H header file complaining about the typedef interface lines of code any more. Must be using 'rarely used stuff'...
2. I included these header files:
<br />
#include "WTYPES.H"
#include "ADSIID.H"
#include "iads.h"
#include "Adshlp.h"
3. I added these libraries on the Project Settings : Link : Input : Object/Library Modules :
ActiveDS.lib adsiid.lib
Then I was able to compile and link a project with these lines in it:
<br />
HRESULT hr;<br />
IADs* pads;<br />
hr = ADsGetObject( L"LDAP://rootDSE", IID_IADs, (void**)&pads);<br />
Note that you had IADS and I changed it to IADs
|
|
|
|
|
I tried it and becomes this:
--------------------Konfiguration: Test5 - Win32 Debug--------------------<br />
Kompilierung läuft...<br />
StdAfx.cpp<br />
Kompilierung läuft...<br />
Test5.cpp<br />
d:\program files\microsoft visual studio\vc98\include\iads.h(3346) : error C2283: 'get_DefaultContainer' : Rein virtuelle Methoden sind in unbenannter Klasse/Struktur struct nicht erlaubt<br />
d:\program files\microsoft visual studio\vc98\include\iads.h(3349) : error C2283: 'put_DefaultContainer' : Rein virtuelle Methoden sind in unbenannter Klasse/Struktur struct nicht erlaubt<br />
d:\program files\microsoft visual studio\vc98\include\iads.h(3351) : error C2627: '<unbekannt>' : Member-Funktion in einer unbenannten Klasse definiert<br />
d:\program files\microsoft visual studio\vc98\include\iads.h(3351) : warning C4094: Unbenanntes 'struct' deklariert keine Symbole<br />
<br />
Test5.exe - 3 Fehler, 1 Warnung(en)
After this i set a preprozessor definition "CINTERFACE" to use the standard C interface and my compile works. Now i will try to get the information from LDAP. If you knew something about this errors, please tell me.
Otherwise i will try it with the work around.
Thank you
Carl
|
|
|
|
|
At last i get also the last errors. Maybe i destroyd the iads.h or it got the bug in a privious action.
thank you
|
|
|
|
|
How to change default icons in MDI application? I edit them in recsorce editor, save project changes and run application, but all icons remain the same as if without modification. But they are modified in .ico files under \\res folder but after application startup old icons appear?
9ine
|
|
|
|
|
You are probably only modifying one resolution of the icon. I think that each one has at least two resolutions, 16x16 and 32x32. In some cases, a 48x48 resolution also exists.
"Ideas are a dime a dozen. People who put them into action are priceless." - Unknown
|
|
|
|
|
I've already done with it. I modified not resolution but image contents and it didnt work, then I deleted all icons and created new assigning them all the same ID's and this way it worked?
9ine
|
|
|
|
|
Hi,
I use ATL automation in my project and I want to migrate it to VS 7.1 from VS 7.0.
VS Convert and build the project successfull, but
when I start application I got a crash in:
int AFXAPI AfxWinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance,
LPTSTR lpCmdLine, int nCmdShow)
in line:
if (!pThread->InitInstance())
pThread == NULL !!!!
This crash have place in all old project (VS 6.0 or 7.0) after convertion.
You can see it for example in Nick Hoddup sample from this:
http://www.codeguru.com/Cpp/COM-Tech/atl/atl/article.php/c55/
sample:
http://www.codeguru.com/code/legacy/atl/AutoATL.zip
I have no idea to correct this situation....
Plaese help..
|
|
|
|
|
hi
i am doing a part of the a project and i am stuck . i am supposed to fix a bug .in here some of the controls in the control panel are fixed due to the need and coz of that whenever the DPI value is changed in the settings the controls in the panel will not expand and givng problems so
i want DPI(dots per inch ,windows XP) values in the VC++ code
plz help me
|
|
|
|
|
Check out GetDeviceCaps() and GetSystemMetrics() .
"Ideas are a dime a dozen. People who put them into action are priceless." - Unknown
|
|
|
|
|
hi
thanks for responding
i checked it i didn't get a suitable one to get the dpi value
can u send a bit of a code on how to get it
plz
|
|
|
|
|
chethankumar.U wrote:
i checked it i didn't get a suitable one to get the dpi value
You must not have checked very hard. It says right there in the documentation for GetDeviceCaps() that LOGPIXELSX and LOGPIXELSY can be used to get the pixels per inch of a particular device. Also, the documentation for GetSystemMetrics() shows that SM_CXSCREEN and SM_CYSCREEN can be used to get the width and height, in pixels, of the screen.
"Ideas are a dime a dozen. People who put them into action are priceless." - Unknown
|
|
|
|
|
is DOts per inch and pixels per inch are same
if not is their any relationship
|
|
|
|
|
chethankumar.U wrote:
is DOts per inch and pixels per inch are same
The last time I checked, a pixel was a dot.
"Ideas are a dime a dozen. People who put them into action are priceless." - Unknown
|
|
|
|
|
hi
is someone out there .
|
|
|
|
|
Sometimes you must wait more than 65 mintues for a reply.
Sometimes you must wait more than 65 minutes for a USEFUL reply
|
|
|
|
|
If you'd get to work a little earlier and start answering questions, we wouldn't have these problems!
"Ideas are a dime a dozen. People who put them into action are priceless." - Unknown
|
|
|
|
|
Hi all!
I have a project where I have to write documentation for source code.
As I have no experience in writing documentation, I wanted to ask you guys- does any of you have any experience with that, and what recommendations could you give? Eventually links to good articles about that?
Thank you!
Iliya Yordanov,
www.csharp-home.com
|
|
|
|