Jump to content
Xtreme .Net Talk

Recommended Posts

Posted

I am moving from C# and VB to C++. I am attempting to make a project that enumerates all of the open windows, returns the handle of the window, the captions and the class of the window. The problem I am running into is, it says that it connot convert ENUMWNDPROC to BOOL. In all of the examples it compiles, but if I just even try copy and paste it doesn't work for me. I must have something wrong but I am not sure. I have attached my code and hopefully someone will say "Hey sean, you're stupid just do this!". I just don't understand which setting i need to have :confused: .

 

Thanks guys!

cEngine.zip

-Sean
Posted

Figured it out... Seems as though everyone on this forum (xtremedotnettalk) only does vb... almost as no one does C++ anymore... oh well...

 

Anyway the answer was that I had to make my callback static and take out the EnumWindows declaration from my class.

-Sean
  • Administrators
Posted

Not to state the obvious but this is a .Net forum ;) and unless you need to use C++, VB and C# are a hell of a lot easier to use and overall a more productive environment IMNSHO.

 

Don't take that as C++ isn't wanted here - just that it's not the primary language for most folk here as far as I am aware. (perhaps more questions and postings from those who do use it may draw in a larger audience and prove me wrong - so please don't stop)

Posting Guidelines FAQ Post Formatting

 

Intellectuals solve problems; geniuses prevent them.

-- Albert Einstein

Posted (edited)
Not to state the obvious but this is a .Net forum ;) and unless you need to use C++' date=' VB and C# are a hell of a lot easier to use and overall a more productive environment IMNSHO.[/quote']

 

I guess so [minus the C++.NET reference to this being a .NET forum], though if your application needs any type of speed (I have seen many posts that need high speed computing), you almost have to go to C++. I would use C# all the time, if it weren't for the (purposely) lack of pointers (unsafe marked code) being only intrinsic data types. I ran a program made in C# that found the Handle, Class, and Window Text using EnumWindows. I wrote the same program now, in C++. The C++ program runs about twice as fast (using GetTickCount).

 

I just wish I knew more about C++ so that I could help on this forum more. Plus I would like to start writing device drivers and such because of the lack of drivers for linux. I want to get more into OS Programming and less of the programming for the general populus. I must say that I greatly enjoyed ASM programming in ASM for embedded devices; the code just seemed so logical. I guess I just like having ultimate control ;)

 

Edit:

/*

There are just some things you can't do (that I know of) with VB and C#. Example being, Is it possible using VB.Net or C#.Net to talk to a usb hub controller? I am talking pure .NET, no importing C code from another source. Talking to another bluetooth device?

*/

 

To stop ranting, I love this forum (THE WHOLE THING, not just this section) and am glad for all the help I have received.

Edited by coldfusion244
-Sean

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...