generic c++ +< windows.h>

Posted on 2007-11-28
Last Modified: 2010-04-01

is it possible to make this function available to generic c++ without having to use visual studio?
Question by:Troudeloup
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 4
  • 3
LVL 86

Accepted Solution

jkr earned 200 total points
ID: 20368962
Well, you will need windows.h for the declaration of 'keybd_event()' and all the constants used there. Apart from that, it should work with any compiler.

Author Comment

ID: 20368997
method wise - the sample code cannot be used directly. right?

can you venture on a guess on how he accomplish this?

send ("hellow world!")

in a string and then automatically looked up codes for each symbol -

no wait, he could do string1[n]  and then replace each with codes he looks up!

" " = vk_space, or something

LVL 40

Assisted Solution

evilrix earned 300 total points
ID: 20369020
Unfortunately, in C++ there is no generic and cross platform (by this I mean the OS, not the compiler!) way to do such keyboard scanning as it is not defined by the standard. Each platform will provide it's own way to achieve this.
[Live Webinar] The Cloud Skills Gap

As Cloud technologies come of age, business leaders grapple with the impact it has on their team's skills and the gap associated with the use of a cloud platform.

Join experts from 451 Research and Concerto Cloud Services on July 27th where we will examine fact and fiction.


Author Comment

ID: 20369090
oh i should empasize that I want to use  kbevent  on windows with windows sdk!

i want to avoid visual studio for now.
LVL 40

Assisted Solution

evilrix earned 300 total points
ID: 20369119
>> i want to avoid visual studio for now.
I have this strange feeling of deja vu :)

I don't know why you don't just prototype it using VS first and then; once you are more comfortable with what you are doing look to migrate to another compiler. I'm sure it'd be a lot less painful for you :)

Author Comment

ID: 20369149
actually i have menu, children window, windows help, and terminology phobia and it's really bad.

i find dealing with only c++ code in text compiler with color coding a little less steep on the curve.

LVL 40

Assisted Solution

evilrix earned 300 total points
ID: 20369178
You are a strange one Troudeloup, but a source of much amusement :)
LVL 40

Expert Comment

ID: 20369212

Featured Post

On Demand Webinar - Networking for the Cloud Era

This webinar discusses:
-Common barriers companies experience when moving to the cloud
-How SD-WAN changes the way we look at networks
-Best practices customers should employ moving forward with cloud migration
-What happens behind the scenes of SteelConnect’s one-click button

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In days of old, returning something by value from a function in C++ was necessarily avoided because it would, invariably, involve one or even two copies of the object being created and potentially costly calls to a copy-constructor and destructor. A…
Often, when implementing a feature, you won't know how certain events should be handled at the point where they occur and you'd rather defer to the user of your function or class. For example, a XML parser will extract a tag from the source code, wh…
The viewer will learn how to clear a vector as well as how to detect empty vectors in C++.
The viewer will be introduced to the member functions push_back and pop_back of the vector class. The video will teach the difference between the two as well as how to use each one along with its functionality.

623 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