|
Hi everyone.
I have an application with a photo realistic interface and i want to use a non standard LCD type font. Is there some way i can include this inside the app like a resource, or do i really need to install it onto the users machine with the program? I cant seem to find any information on how to do this?
Any pointers would be appreciated
M
|
|
|
|
|
|
I have been writing and testing my code on win xp, and today when I tested it on win 98 it allways fails at binding the socket. WSAGetLast error is returning 0 so i don't know what is wrong. Anyone had similar problems?
[CODE]
WSADATA wsaData3;
sockaddr_in service;
service.sin_family = AF_INET;
service.sin_addr.s_addr = INADDR_ANY;
service.sin_port = htons(1336);
char recvbufer[1000];
int bytes;
int err = WSAStartup( MAKEWORD(1,0), &wsaData3 );
if(err)
MessageBox(NULL, "couldnt start", "err", 0);
SOCKET m_socket3 = socket( AF_INET, SOCK_STREAM, IPPROTO_TCP );
if ( bind( m_socket3, (SOCKADDR*) &service, sizeof(service) ) == SOCKET_ERROR ) {
MessageBox(hwnd, "Error starting up. Is another server running on this port?\n", "Error", MB_ICONSTOP);
err = WSAGetLastError();
sprintf(recvbufer, "%i", err);
MessageBox(NULL, recvbufer, recvbufer, 0);
PostQuitMessage(0);
}
if ( listen( m_socket3, 1 ) == SOCKET_ERROR ){
MessageBox(hwnd, "Error listening on socket.\n", "Error", MB_ICONSTOP);
PostQuitMessage(0);
}
[/CODE]
|
|
|
|
|
Hi friends
Please help me!
I have opened a new project in Visual Studio,and have selected "Visual C++ Project ----> MFC" from "Project Type" OK?
I want to create a simple windows service,
Now
1) which item I shude select from "Templates" ?
2) Please tel me: "what shude I do then?"
Step By Step Please ( Such as a wizard )
Excuse me! I do not know English very well
|
|
|
|
|
Moj_Far wrote:
I want to create a simple windows service,
Seems like you want to create service in MFC? But i would like to let you know Visual Studio 6.0 don't provide any Wizard Support for Services in MFC.
Though there are some free third party service framework available in market that can help you create a service skeleton, here is some links :-
http://www.codeproject.com/system/cntservice.asp[^]
http://www.codeproject.com/tools/servicewizard.asp[^]
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
cheers,
Alok Gupta
|
|
|
|
|
hello,
i m developed a simple client-server application.
now i want that in my server i don't accept connections from a list of IP addresses. how do i accomplish it. After accept() call i tried to check the IP of the connecting client and then used closesocket() to close the connection. But the problem is that the client gets connected as the connect() call from the client side works. i don't want that to happen. i want that the server should not accept connection from the list of IPs rather than accepting and then breaking. how do i achieve it?
thanx in advance
|
|
|
|
|
Not possible if you use socket api. What you have to do is to detect the first SYN packet from client IP's and filter on that.
1. Use a firewall (external to your prog).
2. Code raw sockets... i.e be prepared to write your own TCP protocol
|
|
|
|
|
can u provide me with some working example on raw socket? any links?
thanks in advance
|
|
|
|
|
Raw sockets: look at ping.c sample in MSDN..
Raw packet capture library: http://www.winpcap.org
The above two will help you detect a SYN pkt from clients.
But you'll be wasting your time trying to code a conventional client-server prog using the above two methods.. you'll have to write the the entire TCP protocol suite yourself at the server end. Why dont you simply use a packet filter firewall at the server?
|
|
|
|
|
I suppose that you have a good level on networking programming
then do this if not just forget about, sorry
Normaly with Socket API it is not possible, because while calling accept() the client get connect.
For that you need to use some firewall in your program for packet filter
here is am easy way to do that:
INTERFACE_HANDLE hInterface; // interface
PFFORWARD_ACTION defaultAction=PF_ACTION_DROP;
// create the interface
// I create the interface. Predefined acctions, forward all.
DWORD errorCode = PfCreateInterface(0,defaultAction,defaultAction,FALSE,TRUE,&hInterface);
if(errorCode != NO_ERROR)
{
return -1;
}
// Bind the Ip Address with the interface
PBYTE lIp = (PBYTE)&ip; //the ip address of your card
errorCode = PfBindInterfaceToIPAddress(hInterface, PF_IPV4, lIp);
if(errorCode != NO_ERROR)
{
PfDeleteInterface(hInterface);
hInterface = NULL;
return -1;
}
/////////////////////////////////////////////////////
now here do with the code
{
DWORD result;
PIP_ADAPTER_INFO pAdapterInfo = NULL, aux;
IP_ADDR_STRING *localIp;
unsigned long len = 0;
GetAdaptersInfo(pAdapterInfo, &len);
pAdapterInfo = (PIP_ADAPTER_INFO) malloc (len);
result = GetAdaptersInfo(pAdapterInfo, &len);
if(result != ERROR_SUCCESS)
{
AfxMessageBox("Error getting adapters info.");
return;
}
// Fill the real filter struct
PF_FILTER_DESCRIPTOR ipFlt;
ipFlt.dwFilterFlags = FD_FLAGS_NOSYN;
ipFlt.dwRule = 0;
ipFlt.pfatType = PF_IPV4;
ipFlt.dwProtocol = protocol; // value is : TCP =6;UDP=17 or ICMP=1
ipFlt.fLateBound = 0;
ipFlt.wSrcPort = srcPort; // source port
ipFlt.wSrcPortHighRange = srcPort; // source port range
ipFlt.wDstPort = dstPort; // destination port
ipFlt.wDstPortHighRange = dstPort; // destination port range
unsigned long lIpSrc = CharToIp(srcIp); //chartoIP convert (*.*.*.*) to long
unsigned long lIpDst = CharToIp(dstIp);
unsigned long lMaskSrc = CharToIp(srcMask);
unsigned long lMaskDst = CharToIp(dstMask);
ipFlt.SrcAddr = (PBYTE) &lIpSrc;
ipFlt.SrcMask = (PBYTE) &lMaskSrc;
ipFlt.DstAddr = (PBYTE) &lIpDst;
ipFlt.DstMask = (PBYTE) &lMaskDst;
DWORD errorCode;
// I add the filter
if(direction == IN_DIRECTION || direction == ANY_DIRECTION)
errorCode = PfAddFiltersToInterface(hInterface,1,&ipFlt,0,NULL,NULL);
if(direction == OUT_DIRECTION || direction == ANY_DIRECTION)
errorCode = PfAddFiltersToInterface(hInterface,0,NULL,1,&ipFlt,NULL);
}
Not that when stopping your server
call PfDeleteInterface(hInterface); to delete your interface
Pierre kande
For serving you
|
|
|
|
|
Hello every one~
I want to get E-Mail account infomation of OutLook( express , XP, 2003... )
for example,
Incomming E-Mail Address( POP3 ) : mail.codeproject.com
Outgoing E-Mail Address( SMTP ) : mail.codeproject.com
User Name : bluebird
E-Mail Address : bluebird@codeproject.com
User ID : bluebird
User PassWd : ********
How to get this Infomation?
I have been saw about MAPI.
but I can't get Information that I want
Help me please.
and sorry for my little English
|
|
|
|
|
Blue-Bird wrote:
I have been saw about MAPI.
but I can't get Information that I want
What about Extended MAPI? Since you are interacting with Outlook, there's also CDO.
"Ideas are a dime a dozen. People who put them into action are priceless." - Unknown
|
|
|
|
|
I asked about this several times in the C# forum and got no reply. Is there a way to use C# to impliment the solution you're suggesting ?
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
Christian Graus wrote:
Is there a way to use C# to impliment the solution you're suggesting ?
Yeah I know one interface which enumerate Email,LDAP and news group Account for Outlook Express and that is IImnAccount and IImnAccountManager interface
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
cheers,
Alok Gupta
|
|
|
|
|
Christian Graus wrote:
Is there a way to use C# to impliment the solution you're suggesting ?
I do not know. I've never used C# before.
"Ideas are a dime a dozen. People who put them into action are priceless." - Unknown
|
|
|
|
|
um...
Do you give me more informations and sample source and URL?
thanks in advance
|
|
|
|
|
Try these links:
http://www.wischik.com/lu/programmer/mapi_utils.html
http://www.dimastr.com/outspy/default.htm
http://support.microsoft.com/kb/
http://www.softlookup.com/tutorial/vc++/vcu35fi.asp
"Ideas are a dime a dozen. People who put them into action are priceless." - Unknown
|
|
|
|
|
thanks a lot!
Have a good job~
|
|
|
|
|
Wassup pal.. writing a trojan??
Want the code in C ??
|
|
|
|
|
no...
I make a Spam Mail Filter.
I want to get it for user's convenience
|
|
|
|
|
Ok..
read the all reg values under
HKCU\SOFTWARE\Microsoft\Internet Account Manager\Accounts\
All the goodies you want are there...
|
|
|
|
|
um...
I use WinXP.
and
there is no path HKCU\SOFTWARE\Microsoft\Internet Account Manager\Accounts\
check it again.
but
Thanks, have a good job
|
|
|
|
|
HKCU means HKEY_CURRENT_USER..
HKCU\SOFTWARE\Microsoft\Internet Account Manager\Accounts\ key is there in ALL Windoze boxes pal. XP/2003 etc etc. look it up again.
|
|
|
|
|
I know that HKCU means HKEY_CURRENT_USER..
and Checked again
but there's no regsitry...
|
|
|
|
|
I checked it other PC and looked up that
but there's no registry still...
what's wrong my PC?
thanks... for your help.
and
Do you know probleum of my PC
I installed OutLook2003.
and running now.
|
|
|
|