|
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.
|
|
|
|
|
|
Thanks, Andrew buddy!
Geo
|
|
|
|
|
unresolved external symbol "public: __thiscall CDEPODLG::CDEPODLG(class CWnd *)" (??0CDEPODLG@@QAE@PAVCWnd@@@Z)
Debug/mems_fab.exe : fatal error LNK1120: 1 unresolved externals
what does this error means?
|
|
|
|
|
It means that the linker couldn't find a definition for the function it mentions (a constructor for the class CDEPODLG that takes a CWnd* parameter).
Either you didn't include the source file that contains that function in the project, or you haven't implemented it.
|
|
|
|
|
i have a database problem, description: i have dialog A with listbox and button A, based on what item user chose in listbox, i will pop up dialog B with the data record for that item when button A is pressed. Then in dialog B, user can edit the data of that current record, problem is whenevr user edit the current record, it actually overwrites my 1st record in the database. this means the pointer nt pointing to current record coz i open and find the record in dialog A's code then close database, then i open database again in dialog B, by then the pointer prob reset itself... how do i link these 2 dialogs with my edit working properly?
|
|
|
|
|
What SQL code are using for updating the record?
|
|
|
|
|
Hello, everyone!
After setting a break point on some statements, and run Build --> Start Debug --> Go from Build Menu of VC 6.0, the following dialog occurs:
----------
Does not contain debugging information. Press OK to continue.
----------
BTW: my project is a MFC project.
How to enable debug ability in my project?
Thanks in advance,
George
|
|
|
|
|
You're probably trying to debug a release build. For general debugging, you want to have a debug build. In the Build > Set Active Configuration dialog, you should have the configuration ending in 'Win32 Debug' selected.
The message pops up because the executable doesn't contain a section called the Debug Directory, which tells the debugger where to find debugging information. This information takes up a lot of space, and so is only generated if you ask for it.
If you need to debug a release build, you need to build it with debugging information turned on. In Project > Settings, select 'Win32 Release' in the Settings For box, then on the C++ tab, select the General category and select Program Database in the Debug Info drop-down. Then, on the Link tab, in the General category, check the Generate Debug Info box. Rebuild your project.
|
|
|
|