|
Hello and good day!
I want to implement a virtual keyboard for my project. Although the Windows XP already provides one for use, I need the buttons and font to be bigger in size. I'm thinking of currently creating my own virtual keyboard but I want to make sure first if there would be other ways available. Should I create one or are there any other easier methods that I can use? If you say that I should create one, giving me pointers on what is needed would be a great help (currently reading SendInput function). Please note that what I'm gonna implement is a japanese keyboard and buying software is not an option.
Thank you for the help and time!
|
|
|
|
|
Hi,
As MainFramer I knowing that knowing Assembler always helped understand concepts
Anyway to the point I wrote some inline _asm code in a Method
In order to access the data in the Class I realized that the "this"
pointer (pointer to the object) resides on the stack after
paramter variables
I also relized when trying to initilize data with static that I had
to do it in the program
Why ??? the storage for static attribue members do not reside in the
Object rather in the program
This point was further driven home in my _asm code I tried to
access the data the way it was documented on the MSDN page
following is the the code from the MSDN web page
InlineAssembler_Accessing_C_asm_Blocks.cpp
// processor: x86
#include <stdio.h>
struct first_type
{
char *weasel;
int same_name;
};
struct second_type
{
int wonton;
long same_name;
};
int main()
{
struct first_type hal;
struct second_type oat;
__asm
{
lea ebx, hal
mov ecx, [ebx]hal.same_name ; Must use 'hal'
mov esi, [ebx].weasel ; Can omit 'hal'
}
return 0;
I used the following code to access the data in a my Class
First a example of my class
class MYClass
{
private:
static char *c;
static int d;
public:
.
.
.
etc
Now My _asm code
void MYClass :: class(int a, int b)
{
_asm
{
mov ebx,DWORD PTR 16[ebp] ; get this pointer
lea esi,[ebx].d
I got a compile/assemble error when "d" os declared as static
: error C2411: 'd' : illegal struct/union member in 'second operand'
Makes sense becuase when d is declared as static the storage doesn't
reside in the Object
So Whats my question ????
If I use the static attribute how can I access it in _asm code
Thankx
|
|
|
|
|
I have had this problem before, I just cheated.
int *dPtr = &d;
then u can just lea the dPtr value.
|
|
|
|
|
I got error LNK2001 When I tried that I didn't Lea since the pointer had the address all I had to do was a mov instruction
|
|
|
|
|
I'm creating a backup program, and I need to be able to open files with the ACCESS_SYSTEM_SECURITY privilege.
However, when I specify this privilege in my call to CreateFile, it tells me I'm missing a "required privilege" even when I run it as Admin.
This is on Vista.
What are the steps for getting the required privilege to open files with this access right?
“Cannot find REALITY.SYS...Universe Halted.”
~ God on phone with Microsoft Customer Support
|
|
|
|
|
hi
i have created adialog based application.but i just found out recently that it is hard to link a database to adialog("such as displaying results in an edit box ")
Is it really that difficult??
and can some one tell me how to do it???
please i really need it ("its for my project and i will reach my time limit soon ")
please >>>any help will be appreciated.
thank u in advance
Lahom
|
|
|
|
|
Did you search on the codeproject?
|
|
|
|
|
Hi,
I wanna know how could i drew a few cercles just by typing with lines of code. I'm under MFC on MSVS 6.0. is there some struct that could help me to drew such shapes?
hope that i wrote right
And thank you.
"The Ultimate Limit Is Only Your Imagination."
modified on Sunday, April 6, 2008 4:21 PM
|
|
|
|
|
Do you mean something like this?
void CMyWnd::OnPaint()
{
CPaintDC dc(this);
dc.Ellipse(10, 10, 50, 50);
}
Or do you want to write the circle drawing code yourself? If so, Google "circle drawing algorithm".
Mark
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
Ok so let's say that i wanna drew 3 cercles on my formview, so shoulf i write that code 3 times with different values?
"The Ultimate Limit Is Only Your Imagination."
|
|
|
|
|
did ever heard about loops?
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
|
|
|
|
|
CPallini wrote: did ever heard about loops?
These?[^]
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
Exactly.
BTW turn off your CPMRU , it is not fair using such device for this kind of guess.
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
|
|
|
|
|
lol, I know about loops but the prob that i dont know how many circles that the user wanna, let say 2O so how could i declare the 20 vars for those cercles
for (i=0 ; i< 20; i++)
{
Cercle[i].....??
}
"The Ultimate Limit Is Only Your Imagination."
|
|
|
|
|
You could store the coordinates in an array.
An array container that grows automatically would be even better, like a vector or a CArray.
Mark
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
yup i'm using a vector
but is the form "Formview" suitable for drawing or should i select another type?
i'm new on drawing :s
"The Ultimate Limit Is Only Your Imagination."
|
|
|
|
|
Ok I'tested on a FormView and it works i had a white circle it was a stupid querstion
"The Ultimate Limit Is Only Your Imagination."
|
|
|
|
|
You can draw on any window.
A CFormView is useful when you have controls you need to layout on the window like a dialog window.
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
You don't necessarily have to write the code three times.
However you write the code, it must call Ellipse() three times.
These are two equivalent examples:
void CMyWnd::OnPaint()
{
CPaintDC dc(this);
dc.Ellipse(10, 10, 50, 50);
dc.Ellipse(30, 30, 70, 70);
dc.Ellipse(50, 50, 90, 90);
}
void CMyWnd::OnPaint()
{
CPaintDC dc(this);
CRect CircleRect(10, 10, 50, 50);
for (int i = 0; i < 3; i++)
{
dc.Ellipse(&CircleRect);
CircleRect.OffsetRect(20, 20);
}
}
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
when i click on the butoon nothing is drawin !!!
is it a prob of reference to the dc .?
<br />
void CSecondForm::OnButton1() <br />
{<br />
<br />
CPaintDC dc(this);<br />
dc.Ellipse(20, 20, 100, 100);<br />
}<br />
"The Ultimate Limit Is Only Your Imagination."
|
|
|
|
|
You can only use a CPaintDC when responding to a WM_PAINT message (in OnPaint()).
Use a CClientDC in your button click handler instead...
void CSecondForm::OnButton1() <br />
{<br />
<br />
CClientDC dc(this);<br />
dc.Ellipse(20, 20, 100, 100);<br />
}
Mark
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
Thank you It works now.
but a last question ? how could i write a text into the cercle like "Cercle1" etc..
ANd thank you for your help.
"The Ultimate Limit Is Only Your Imagination."
|
|
|
|
|
You'll need to select a font into the DC (unless you want to use the default font), then you can use any of the
GDI text rendering functions (CDC::DrawText[Ex](), CDC::TextOut(), CDC::ExtTextOut(), etc.) to draw the text.
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
<br />
void CSecondForm::OnButton1() <br />
{<br />
<br />
CClientDC dc(this); <br />
dc.Ellipse(10, 10, 70, 70);<br />
dc.Ellipse(20, 20, 70, 70);<br />
dc.Ellipse(30, 30, 70, 70);<br />
dc.Ellipse(40, 40, 70, 70);<br />
CString str;<br />
str="Cercle";<br />
CDC::TextOut(100,100,str);<br />
}<br />
CDC::TextOutA' : illegal call of non-static member function
i atried even with CDC::TextOut(100,100,"Cercle");
Same prob
"The Ultimate Limit Is Only Your Imagination."
|
|
|
|
|
I found it, srry for the multipost.
void CSecondForm::OnButton1()
{
// TODO: Add your control notification handler code here
CClientDC dc(this);
dc.Ellipse(10, 10, 70, 70);
dc.Ellipse(20, 20, 70, 70);
dc.Ellipse(30, 30, 70, 70);
dc.Ellipse(40, 40, 70, 70);
CString str;
str="Cercle";
dc.TextOut(100,100,str);
}
"The Ultimate Limit Is Only Your Imagination."
|
|
|
|