|
Thanks for your fast feedback. I alredy record my welcome message, but my problems now is how i want to add the record to my C++ application. Got any application sample or article?..i will appreciate your help.
|
|
|
|
|
Did you bother reading the link I gave you in my previous post ??
|
|
|
|
|
Maybe off-topic, since I do not know what kind of application you are working on, but if you do something like that, do not forget to provide an option to deactivate it. Seems like a cool feature the first three times you use the software, but can become really annoying.
~RaGE();
|
|
|
|
|
nevermind, thats a good idea.thanks for remind me. Do you got any sample or article that i can refer how can i add the record into my application?..thanks
-- modified at 20:43 Thursday 26th January, 2006
|
|
|
|
|
Insert the Microsoft Agent Activex control (agentctl.dll) into your project and then you can use code like:
CAgentCtlCharacters m_AgentCharacters;
CAgentCtlCharacterEx m_AgentCharacter;
...
m_AgentCharacters = m_agent.GetCharacters();
m_AgentCharacters.Load("Robby", _variant_t("robby.acs"));
m_AgentCharacter = m_AgentCharacters.Character("Robby");
m_AgentCharacter.Show(_variant_t());
m_AgentCharacter.Speak(_variant_t("My name is Robby. What is your name?"), _variant_t());
"The greatest good you can do for another is not just to share your riches but to reveal to him his own." - Benjamin Disraeli
|
|
|
|
|
Hi,
How do we change the color of the button?
Thanks,
Wax
|
|
|
|
|
You will need to implement an ownerdrawn button, if you need to change the appearance such as the face colour. Try one of the many button controls[^] thats here at CodeProject.
I Dream of Absolute Zero
|
|
|
|
|
Handle the WM_CTLCOLORBTN notification message in the parent window of the button.
Steve
|
|
|
|
|
Stephen Hewitt wrote: Handle the WM_CTLCOLORBTN notification message in the parent window of the button.
This won't work.
Jesus Loves <marquee direction="up" height="40" scrolldelay="1" step="1" scrollamount="1" style="background:#aabbcc;border-bottom:thin solid 1px #6699cc">
--Owner Drawn
--Nothing special
--Defeat is temporary but surrender is permanent
--Never say quits
--Jesus is Lord
|
|
|
|
|
I tried it just then and you are correct, it doesn't work. A more careful read of the documentation (as you often find yourself doing when stuff won't work) reveals the following:
"only owner-drawn buttons respond to the parent window processing this message".
Steve
|
|
|
|
|
Stephen Hewitt wrote: I tried it just then and you are correct, it doesn't work
Even I kept trying for sometime.
What puzzles me is that what purpose does it accomplish?
Jesus Loves <marquee direction="up" height="40" scrolldelay="1" step="1" scrollamount="1" style="background:#aabbcc;border-bottom:thin solid 1px #6699cc">
--Owner Drawn
--Nothing special
--Defeat is temporary but surrender is permanent
--Never say quits
--Jesus is Lord
|
|
|
|
|
I found myself wondering the same thing.
Steve
|
|
|
|
|
Respected All
Regards!
i developed aclass of printing, it works fine but the print did not come on the middle of the page,that's start from the TOP LEFT margine of the page,plz mentioned the changes so that i may able to get the print on the center of the page.
Thanks n advance.
David
david
|
|
|
|
|
Following the "brute force and pig-ignorance" approach, I do the following to print an image (C code, but it should give the idea):
iPageX = GetDeviceCaps (hdcPrn, HORZRES) ;
iPageY = GetDeviceCaps (hdcPrn, VERTRES) ;
iTopMargin = iPageY / 10;
iLeftMargin = iPageX / 10;
iPageX = iPageX - iLeftMargin - iLeftMargin;
iPageY = iPageY - iTopMargin - iTopMargin;
StretchDIBits(hdcPrn, iLeftMargin, iTopMargin, iPageX , iPageY,
0, 0, iImageMaxX, iImageMaxY, lvpBits, lpBitMapHeader,
DIB_RGB_COLORS, SRCCOPY);
I hope I haven't missed any relevant steps!
|
|
|
|
|
hi
how should i handle keystrokes in a dialog???
i handle them with PreTranslateMessage() but it seems that it handles a single keystroke for example twice or more! so the code executes more than once. what should i do??
i do sth like this:
PreTanslateMessage(MSG*msg)
{
switch(msg->wpraram)
{
case VK_UP:
//do the code
}
}
but the code executes more than once
|
|
|
|
|
In most cases handling them in PreTranslate message is unusual. If you want to however the code should look something like this:
<br />
PreTanslateMessage(MSG*msg)<br />
{<br />
if ( msg->message == WM_CHAR )<br />
{<br />
switch(msg->wpraram)<br />
{<br />
case VK_UP:<br />
}<br />
}<br />
}<br />
Steve
|
|
|
|
|
hamidreza_buddy wrote: switch(msg->wpraram)
{
case VK_UP:
//do the code
}
switch(msg->wpraram)
{
case VK_UP:
return TRUE;
}
return FALSE;
Now it will process only once.
Jesus Loves <marquee direction="up" height="40" scrolldelay="1" step="1" scrollamount="1" style="background:#aabbcc;border-bottom:thin solid 1px #6699cc">
--Owner Drawn
--Nothing special
--Defeat is temporary but surrender is permanent
--Never say quits
--Jesus is Lord
|
|
|
|
|
Hi,
I need to buy a developer kit from a third party
software company. Since I'm developing my application
with VC++. So, it makes sense to buy the C++ developer kit.
That software company got developer kit in Jave, .Net, VB,
& a C++/ActiveX demo code.
I compiled and ran the C++ demo code but still a bit confused.
I probably will call that company tomorrow morning to
ask some questions.
But I wonder, normally, how the people use ActiveX?
In what situation?
Is that mainly for www application?
http://www.active-x.com/articles/whatis.htm
Maybe someone can share his/her knowledge with me?
Thanks,
Kevin
Kevin
|
|
|
|
|
ActiveX are components that can be used in any language (but of course, this is a Microsoft technology). You can also use them as a component in a Word or excell sheet...
It is not necessarily for web applications.
Typical examples of ActiveX are for example the MSFlexGrid (a grid control), some calendar controls, graph controls, ...
ActiveX files (ocx files) are in fact "enhanced dll's" that means this is a standard dll format files with some default functionnlity that allozs you to retrieve and use objects inside it.
Hope things are clear
|
|
|
|
|
Hi,
Is there a way to make your button curved? I'm not using .NET, just plain visual c++ and mfc.
Thanks for all the help.
waxie
|
|
|
|
|
I think the buttons can be made curved using SetWindowRgn(...) . You can first create the region using CreateEllipticRgn(...) or something like that.
If the result is not what you want then combining regions with owner-draw buttons will do it. There are lots of owner-draw buttons here on CP.
this is this.
|
|
|
|
|
Hi,
I have a win-app. In the program, there is a time, I need to have dialog window, so that user can browse and select input file for the program. Do you know any simple and quick way to creat such thing?
Also, I need to add in a program a simple registration dialog, any suggestion and example how to do that?
Thank in advance
Jim
Jim
|
|
|
|
|
To browse a file, you can use CFileDialog fd(TRUE);
then
int nResult = fd.DoModal();<br />
if (nResult == IDOK)<br />
{<br />
CString strPath = fd.GetPathName();<br />
}
Now strPath has the full path to the selected file.
To create some registration dialog, there are many ways to do it. It depends on what kind of registration you want to set.
If you do not want the user to run the program even once without registration, then you can:
Read a particular location from registry for the software key. If that key is read ok, then good. Else show a registration dialog like this:
Create a dialog resource. Attach a class to it, put a editbox on it. If the software is not registered, then create this dialog:
CRegDialog reg;<br />
reg.DoModal();
Now check the value the user entered into the editbox. If it is really the key, then save it to the registry at that particular location, and go on with the program. Else exit program.
But as I said, there are many ways to set program registration things.
this is this.
|
|
|
|
|
Hi Khan,
I tried that, but I got a Debug Assertion Failed! It said :" Program c:\Test.exe File afxwin1.inl Line 22, as soon as the code executes the line "CFileDialog fd(TRUE)". I guess I must have some thing wrong with my project setting. Any idea?
Thank
Jim
|
|
|
|
|