|
|
|
How can i access and change a symbol in a CString variable??
|
|
|
|
|
CString overloads the array access operator [], so you can access it and modify characters as if it were just a character array.
e.g.
CString sTmp( _T("abcdefgh") );
TCHAR ch = sTmp[1]; // ch = 'b'
sTmp[4] = 'q'; // sTmp is now "abcdqfgh"
Dave
http://www.cloudsofheaven.org
|
|
|
|
|
|
Hi guys,
I am a beginner coder, and I would like to gain some experience with Visual C++. I have been coding for a while in C++, and C, and now I would like to have a small project to work on. Something for a beginner, that is an easy to tackle problem, but smthg that will get me experience...Yeah! I am in desperate need of getting experience...do you happen to know of a project that you might have done, or a website where I can find such small project ideas?!
Thanks a lot, and hope to hear from you!
|
|
|
|
|
a lot of schools post computer project assignments for their students to complete online...mine does.
http://www.cse.msu.edu/~cse231/Projects/
thats the url of the beginning c++ course's project assignments at my school.
*.*
cin >> knowledge;
|
|
|
|
|
Hi,
I have trouble with variable where used in thread function. I defined thread function such as;
UINT Processor(LPVOID lpParameter)
{
.
.
.
return ulCOMObjReturnValue;
}
STDMETHODIMP COLAP::GetState(long SystemID)
{
.
.
.
DWORD ulExitCode;
bThreadState = ::GetExitCodeThread(pQueue->hThread, &ulExitCode);
return ulExitCode; // Set return value
}
pQueue->hThread has thread id, but GetExitCodeThread() function can not return right value except debugging.
Thank you for your responses.
|
|
|
|
|
return (DWORD)n; try this
|
|
|
|
|
Hi,
I have installed VS.NET 2003.
I have generate a C++ application.
My application has not the Windows XP Styles even if the operating system is
XP Pro.
I want to know if I have to select an option in the VS.NET IDE to get the XP
Style.
I have read an article here who explain to uilize a manifest file with
Visual C++ 6.0. I have do it and it is working.
Do I have to do the same with VS.NET 2003 ?
Thanks,
Claude
|
|
|
|
|
Feel free to correct me at any time as I am still trying my best to learn this API. I know that there is a SOCKADDR structure that is able to hold data and family type. I also know that there is a SOCKADDR_IN structure that is able to hold an address, a port number, data and a family type. I have a sendechorequest function set up like this
int CSSPingDlg::SendEchoRequest(SOCKET s, SOCKADDR_IN lpstToAddr);
Now comes the interesting part. Inside this SendEchoRequest function I make a call to the sendto() function. What I take issue with is the fifth parameter of sendto(); which requires a SOCKADDR * that is supposed to contain the address of the host to which to send the data. The problem is that my ping program requires that I use a SOCKADDR_IN structure which is able to hold important information like the IP address of the host. Is there a version of sendto(); that will allow me to pass a SOCKADDR_IN instead of a plain SOCKADDR? Could it be that I am just not using sendto(); correctly.
All I know is that I want to send data to the host specified in the SOCKADDR_IN structure that I have passed to my sendechorequest function. How do I do that?
|
|
|
|
|
From MSDN doc of sendto()
The Microsoft TCP/IP Sockets Developer’s Kit only supports the Internet address domains. To actually fill in values for each part of an address, you use the SOCKADDR_IN data structure, which is specifically for this address format. The SOCKADDR and the SOCKADDR_IN data structures are the same size. You simply cast to switch between the two structure types.
Steve
|
|
|
|
|
Hi all,
I like to change the scrollbar look in RichEdit Control while retaining the orignal functionality.
A RichEdit control having custom scrollbars, with background color and arrows image on the scrollbar.
How can I do this.
Please anybody helps me to do this.
The Phantom.
|
|
|
|
|
Hi,
I am developing a visual c++ project which implement an IE extension. I want to add a new 'protocol' (default IE protocols: http:, ftp:, ms-its: ..., I need to impelement my own, e.g. makecall:, goto to IE, I rem that many years ago I browse MSDN, it may called "pluggable protocol xxx", but I can't find anything in MSDN anymore.
Can any one give me a tip? many thanks.
|
|
|
|
|
|
Can an MFC application be converted to a VB6 application for editing?
|
|
|
|
|
No. I infer from your question that:- You have an MFC application that you need to make changes to.
- You don't know C++.
- You do know VB.
- You don't want to learn C++ and MFC.
I think you need to reconsider the last point.
Software Zen: delete this;
|
|
|
|
|
I know that it's there, I just can't figure out why this error is occuring.
Compiling resources...
Compiling...
StdAfx.cpp
Compiling...
SSPing.cpp
SSPingDlg.cpp
C:\DOCUMENTS AND SETTINGS\ADMIN\DESKTOP\SSPROJECT\SSPing\SSPingDlg.cpp(204) : error C2664: 'sendto' : cannot convert parameter 2 from 'struct tagECHOREQUEST' to 'const char *'
No user-defined-conversion operator available that can perform this conversion, or the operator cannot be called
Generating Code...
Error executing cl.exe.
SSPing.exe - 1 error(s), 0 warning(s)
int CSSPingDlg::SendEchoRequest(SOCKET s, SOCKADDR_IN lpstToAddr)
{
static ECHOREQUEST echoReq;
static nId = 1;
static nSeq = 1;
int nRet;
echoReq.icmpHdr.icmp_type = ICMP_ECHOREQ;
echoReq.icmpHdr.icmp_code = 0;
echoReq.icmpHdr.icmp_cksum = 0;
echoReq.icmpHdr.icmp_id = nId++;
echoReq.icmpHdr.icmp_seq = nSeq++;
for (nRet = 0; nRet < REQ_DATASIZE; nRet++)
echoReq.cData[nRet] = ' '+nRet;
echoReq.dwTime = GetTickCount();
echoReq.icmpHdr.icmp_cksum = checksum((u_short *)&echoReq, sizeof(ECHOREQUEST));
-----> nRet = sendto(s, echoReq, sizeof(ECHOREQUEST), 0, lpstToAddr, sizeof(SOCKADDR_IN));
return 0;
}
|
|
|
|
|
try:-
sendto(s, (char*) echoReq, sizeof(ECHOREQUEST), 0, lpstToAddr, sizeof(SOCKADDR_IN));
The spec says:-
int sendto (<br />
SOCKET s, <br />
const char *buf, <br />
int len, <br />
int flags, <br />
const struct sockaddr *to, <br />
int tolen );
Hell, there are no rules here-- we're trying to accomplish something. - Thomas A. Edison
|
|
|
|
|
Try this: nRet = sendto(s, (char *)&echoReq, sizeof(ECHOREQUEST), 0, lpstToAddr, sizeof(SOCKADDR_IN))
Your original line says you want to pass echoReq by value, whereas you really want to pass a pointer to it.
Software Zen: delete this;
|
|
|
|
|
Hello, everyone!
I just copied a MFC project and double clicked the .dsw file, then I noticed that two MFC projects are loaded into the same IDE.
I want to know for what purpose should us define two projects in the same .dsw file and open them in the same IDE. Do they have some relationships? Do they communicate with each other when running?
I just want to know the general experience of this topic.
Thanks in advance,
George
|
|
|
|
|
You can add two projects, or more to a workspace to setup build dependancies between projects.
For example. project A an executable depends on the project B a DLL.
If you set dependancies you know you always have the most upto date copy.
If you can keep you head when all about you
Are losing theirs and blaming it on you;
If you can dream - and not make dreams your master;
If you can think - and not make thoughts you aim;
Yours is the Earth and everything that's in it.
Rudyard Kipling
|
|
|
|
|
It's also easier to debug both projects like this - you don't have to set up the 'Additional DLLs' box for any libraries you use.
IntelliSense also works for using features of one project in another project (say, if one of the projects is a DLL that exports functions, you can get parameter information when trying to use that DLL).
|
|
|
|
|
Thanks, Mike buddy!
What means "IntelliSense" in your reply?
regards,
Geo
|
|
|
|
|
Microsoft's general term for context-sensitive popup information - for example, the list of available methods that pops up after you type the '.' after an object name, or '->' after a pointer name, or the list of parameters for a method.
This information comes from a pre-parse of your declarations that the environment performs as you type. The parsed declarations are stored in the .NCB file with the same name as the project. This file is also used in the ClassView window - if VC ever complains that 'ClassView information is not available', it probably means that this file is read-only.
|
|
|
|