|
Hi,
I want to do that cartoon character moving on the client window freely as well as speaking(speech). Speech is predefined.
Thanks
|
|
|
|
|
i use CRegKey in InitInstance() to write a string in
HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersio
n\Run
I start run the application.
then i power off my pc when the application keeps running.
after the window restart
i found out that the key in "run" i wrote is disappear.
thats the application cannot be auto run
how can i solve it?
thx
|
|
|
|
|
One solution is to design the application as a service.
Check out the code section for examples.
Kuphryn
|
|
|
|
|
|
Normally, when you write to the registry Windows doesn't make those changes right away, but it stores them in a buffer. There is a flush function somewhere that makes Windows write those changes right away. Look for it either in CRegKey class definition or look at Windows API for the registry functions. Probably, when you restart your computer the buffer has not been flushed.
// Afterall, I realized that even my comment lines have bugs
When one cannot invent, one must at least improve (in bed).-My latest fortune cookie
|
|
|
|
|
i have tried all the flush
CArchieve
CFile
fstream
reg
also cant prevent the data lost......
|
|
|
|
|
I don't know then. Sorry I can't help.
// Afterall, I realized that even my comment lines have bugs
When one cannot invent, one must at least improve (in bed).-My latest fortune cookie
|
|
|
|
|
Hi,
I am working on a winsock applications that utilize IOCP and AcceptEx() winsock extension. Basically, the program is a client/server and can send and receive data. Here is the program.
- server activates IOCP and AcceptEx() listening on port 1000
- client activates IOCP and AcceptEx() listening on port 1000
...
- server sends a package to client (server -> data -> client)
...
- server processes incoming socket from AcceptEx().
At this point, the incoming data is valid. Everything looks good and valid. I tested this via sending of ASCII test. Everything looks valid.
- client process the data and sends data back to server (client -> data -> server).
For some reason, the server never receives the data. IOCP acknowledged the WSASend() post. It even returns the size of the packet. However, the server never receives the packet.
At this point, I have no idea what is causing the problem. At any given time, both client and server can make NEW connections and send data with the initial packet. However, once the other side receives the incoming connection, processes data, and sends back a response, the response DOES NOT arrive.
Please post if you have any idea as to what is causing this problem. I am not too familiar with AcceptEx() in terms of any specific API that must be called once a socket has been accepted. I did implement setsockopt().
Thanks,
Kuphryn
|
|
|
|
|
kuphryn wrote:
- server sends a package to client (server -> data -> client)
...
- server processes incoming socket from AcceptEx().
? Missing connect step(s), who do you have connecting to whom (seeing as you have both 'client' and server listending) ?
Generally you don't have the 'client' accepting, it initiates the connection to the server and the server then uses that new connection to talk to the client.
kuphryn wrote:
I did implement setsockopt()
To do (SO_UPDATE_ACCEPT_CONTEXT) ?
Sorry, but there are too many unknowns to provide much help at this point. I use IOCP and AcceptEx in my server code and IOCP in my client code and i haven't had any problems like this.
...cmk
Save the whales - collect the whole set
|
|
|
|
|
Yeah.
The problem is so weird. Yes, the server does make a connection to the client and the other way around. That is how AcceptEx() returns a valid socket.
I just cannot figure out why once IOCP dispatches a new incoming socket, that socket cannot be used to send or receive data. It is almost like there is a step or two missing. In other words, there is an API call that needs to be made to an incoming AcceptEx() socket. Yes, I implemented SO_UPDATE_ACCEPT_CONTEXT. The problem remains.
Kuphryn
|
|
|
|
|
I am using a common edit control for the purpose of displaying output in text format in my application. Every time I need to write something to the screen I find that I need to put the contents of the edit box into a string put the new output into anothor string, concatenate these two strings togethor and then output this new longer string to the screen. For simplicities sake isn't there a way to just call a function similar to idcoutput->SetWindowText(); that will add text and not overwrite the box with the new text?
Thank you,
Eric Sepich
|
|
|
|
|
If you're using CStrings there is a function called 'Append' that lets you add to a string.
From the looks of it you aren't using DDX so you're still going to have to call SetWindowText in order to set it, but the append function will allow you to just add to the string. Not sure if this is the case for strings other than CStrings, but I bet any type of string has this functionality.
Mike
|
|
|
|
|
CHARRANGE crEnd = {-1, -1};
SendMessage(hwnd, EM_EXSETSEL, 0, LPARAM(&crEnd));
SendMessage(hwnd, EM_REPLACESEL, FALSE, LPARAM(pszText));
Your class library of choice probably wraps those messages into something prettier, but that's the plain SDK version of what you are looking for.
--
-Blake (com/bcdev/blake)
|
|
|
|
|
we know:
{
TCITEM tcItem;
tcItem.mask = TCIF_TEXT;
tcItem.pszText = _T("as");
m_TabShow.InsertItem(0, &tcItem);
tcItem.pszText = _T("df");
m_TabShow.InsertItem(1, &tcItem);
}
can create a TabCtrl...
but how to disable a item of TabCtrl? use m_TabCtrl.SetItemState()??
thanks...
|
|
|
|
|
I'm not sure it's possible, and it would be strange for the user to click on a tab without getting any action done.
SO IMHO there are two solutions:
1) remove the tab
2) disable the controls contained in the tab.
Silence Means Death
Stand On Your Feet
Inner Fear
Your Worst Enemy
|
|
|
|
|
Hi,
I have written a server program which uses a set of APIs. I have managed to get the server to do what is required now the next step is to make this server run as a service. I have tried such things as XYNZservice and srvany and they will indeed run the server up for me however when I try to connect a client to the server the server will bomb out. If I run the server as a normal executable I do not have any problems. I have modified the services login to be the same as the login I used. PLEASE any help will be appreicated......
PS I have very little experience with MS development tools so a hand held approach would be nice.
|
|
|
|
|
Services are really too big a topic to discuss here. I suggest a book: Programming Server-Side Applications for Windows 2000[^], by Jeff Richter and Jason Clark (MS Press).
SRVany and similar programs don't really run your program as a service - they only start up a copy of your program in the service's security context when the service is started, and kill it off (with TerminateProcess , IIRC) when it's stopped.
|
|
|
|
|
Is there anyway to know which controls on the dialog
is been focused?
Thank you
Shin
|
|
|
|
|
|
I'm a beginner writing my 2nd program. I'm stuck. I'm not sure were the problem is. Monthly payment formuls: payment=rate*(1+rate)n/((1+rate)n-1*L rate=monthly interest rate, n=number of payments L=loan amount.
//Patrick Comeau
//Monthly Payments
//Project 2
//oct 1 03
#include <iostream>
#include <cmath>
#include <iomanip>
using namespace std;
int main()
{
float rate = 0.0; //monthly interest rate
float nop =0.0; //number of payments
float loan =0.0; //amount of loan
double pay =0.0 ; //monthly payment
double apb= 0.0 ; //amount paid back
double intpd = 0.0; //interest paid
double num =0.0;
double den=0.0;
cout<< "What is the loan amount " ;
cin>> loan;
cout<< "The number of payment is " ;
cin>> nop;
cout<< "What is the monthly interest rate " ;
cin>> rate;
cout<< "The Monthly payment is " <
|
|
|
|
|
I'm not gonna give you the answer to this because its way too obvious which is why there probably hasn't been a response yet.
Here's a hint. Check out your last three cout statements and think about what they are doing. Shouldn't take long to see the problem.
|
|
|
|
|
You really want to consider Cout'ing pay, apb, and intpd AFTER YOU HAVE CALCULATED THEM.
|
|
|
|
|
Hi,
I have written a SDI application which opens a XML document from the file->open menu and works on it. Now, I want to right click on any xml file and go to the option "open with" and select my SDI application from the list, and the application would show data from the xml file the way it works for the file->open menu. How can do that?
Please advise.
|
|
|
|
|
Sorry for this question in the c++ forum, but people don't reply in the general discussion forums. Is Intel planning on releasing a 64 bit processor as well anytime soon? How long until they might be available for notebooks? Thanks!
By the way...I have to write a program for my class, it's supposed to display "Hello World". I'm a dumbass who doesn't want to do any work, so will everybody on here do my homework for me so later I can help flood the job market with yet another unqualified candidate? Lol, thanks!
Douglas A. Wright
dawrigh3@kent.edu
|
|
|
|
|
int main(){cout<< "Hello world.";}
|
|
|
|