|
sorry to be such a nuisance to ya'll,i have spent a good few hours now trying to get this irc server to accept my connection registration attempts however im having no luck,i wonder if any 1 can maybe spot my error.i think the error might lie within the nick command but im unsure.
CString m_User;
CString m_Nick;
CString m_Channel;
CString m_Pass;
m_Pass = "airplane";
m_Nick = "secret";
m_User = "secret na www.baka-baka.com :chris shread";
m_Channel = "#projectx";
CString PassCommand = "PASS " + m_Pass + "\r\n";
CString NickCommand = "NICK " + m_Nick + "\r\n";
CString UserCommand = "USER " + m_User + "\r\n";
CString JoinCommand = "JOIN " + m_Channel + "\r\n";
send(Socket,PassCommand,strlen(PassCommand),0);
send(Socket,NickCommand,strlen(NickCommand),0);
send(Socket,UserCommand,strlen(UserCommand),0);
send(Socket,JoinCommand,strlen(JoinCommand),0);
it all compiles nicely,when the last send(); is executed i am greeted with a error saying i have to register before i can join a channel,so i know thats where the problemb lies
thanx
chris
|
|
|
|
|
Hi
Make sure you use the USER command the same way I did:
CString UserCommand = "USER " + m_Nick + " 0 * :MN\r\n";
And don't forget to react on PING?-requests from the server in order to not time out.
regards
modified 12-Sep-18 21:01pm.
|
|
|
|
|
hmm its no good just dosent seem to want to register i have tried different variations of code and i have also used ur code agsactly as shown,i realy cant understand how the problemb is occuring.
also a quick question,has my code got to wait 4 a NICK or USER verification before it can proceed with the next command,i thought maybe im sending all the info to quickly for the server.
thanks again for your time,and excelent responses.
chris
uk
|
|
|
|
|
I don't know exactly what really causes your problem, sorry
But I have a suggestion for you: When I began (and never finished) building my own IRC client, I first took a look at the built-in client in the filesharing tool "eMule". It is open source. I learned quite a lot from this source about how the IRC protocol actually works
You can download the latest source here:
http://prdownloads.sourceforge.net/emule/eMule0.30a-Sources_complete.zip?download
regards
modified 12-Sep-18 21:01pm.
|
|
|
|
|
thank you,im sure that will be a great help to me ill d/l the source now and "get stuck in". cheers mate u have been a great help
|
|
|
|
|
No problem! Always happy to help
modified 12-Sep-18 21:01pm.
|
|
|
|
|
Is there any programatic way to get current WAN (global) IP address from the Windows XP machine behind NAT router? If router supports UPnP it may help on this matter, but not sure how to use it. It's easy if other internet server can notify current global IP address to the machine, but it is the last measure and I'd like to prefer independent way, if any.
|
|
|
|
|
I did these 2 programs in turbo c++ and they're supposed to come out like this: Example:
Enter an integer:8
Enter another integer:2
Enter another integer:3
8+2+3=13
So far I got this:
#include "conio.h"
#include "stdio.h"
void main ()
{
int number;
float price;
int number1;
int number2;
int number3;
printf("Enter an integer");
scanf("%d1",& number1);
printf("Enter another integer");
scanf("%d2",& number2);
printf("Enter another integer");
scanf("%d3",& number3);
printf("%d+%d+%d",number1,number2,number3);
getch();
}
and my other one is supposed to come out like this and is similar too:
Example:
Enter a number of eggs:45
45 eggs are 3 dozen eggs with 9 eggs left over.
There is also one other impossible program i'm working on that I seem to have no success on. It reads: run a program that will ask the user for two floating point numbers. The program should display the product(the numbers multiplied together) in the form "The square of __ is __" if the two numbers are the same or "The product of __ and__ is __" if the two numbers are different. I'm been working on them for awhile and have had no success and this is the last place I could turn. Please help me, I will do anything in return. Thanks a lot.
Colin
|
|
|
|
|
colin21 wrote:
printf("%d+%d+%d",number1,number2,number3);
Try:
printf("%d+%d+%d=%d",number1,number2,number3,number1+number2+number3);
Neville Franks, Author of ED for Windows. Free Trial at www.getsoft.com
|
|
|
|
|
Didn't I answer this question a few days ago? You may have to change the cin/cout to scanf/printf if you can only use C.
#include <iostream>
using namespace std;
int main()
{
int Eggs;
cout << "Enter a number of eggs: ";
cin >> Eggs;
cout << Eggs << " eggs are " << Eggs / 12 << " dozen eggs with "
<< Eggs % 12 << " eggs left over.\n";
return 1;
}
Here is the other impossible program with the floats:
#include <iostream>
using namespace std;
int main()
{
float Number1, Number2;
cout << "Enter a float number: ";
cin >> Number1;
cout << "Enter another float number: ";
cin >> Number2;
if ( Number1 == Number 2 )
cout << "The square of " << Number1 << " is ";
else
cout << "The product of " << Number1 << " and " << Number2 << " is ";
cout << Number1 * Number2 << endl;
return 1;
}
Good luck!
Douglas A. Wright
dawrigh3@kent.edu
|
|
|
|
|
Hi!
Is there a way to resize Bitmaps and icons, without clipping. For eg., I want to change a 32x32 bitmap into a 13x13 bitmap and want exactly the same picture in both, i.e, I don't want the bitmap to be clipped when it is changed from 32x32 to 13x13. What I want, is the picture to be resized with the resizing of Bitmap.
|
|
|
|
|
Select all, click on one corner and drag it until it is resized to 13x13. Icons must be a stardard size of a factor of 16 BTW.
|
|
|
|
|
I have a function like this which will read a REG_SZ value from the registry.
When I call it,
<br />
char szProgFiles[MAX_PATH];<br />
RegGetStr(HKEY_LOCAL_MACHINE, "Software\\Microsoft\\Windows\\CurrentVersion", "ProgramsFilesDir", szProgFiles);<br />
the RegQueryValueEx() returns me error "1400 Invalid window handle." What's wrong in my code?
<br />
BOOL RegGetStr(HKEY root, const char* sub, const char* name, char* out)<br />
{<br />
HKEY hKey;<br />
BOOL bResult = false;<br />
if (RegOpenKeyEx(root,sub,0,KEY_QUERY_VALUE,&hKey) == ERROR_SUCCESS)<br />
{<br />
DWORD dwType, dwLength = sizeof(out);<br />
bResult = RegQueryValueEx(hKey,name,NULL,&dwType,(unsigned char*)out,&dwLength)==ERROR_SUCCESS <br />
&& dwType==REG_SZ;<br />
RegCloseKey(hKey);<br />
}<br />
return bResult;<br />
}<br />
|
|
|
|
|
|
i downloaded Ivo Ivanov's api hook source code
i tried to hook some APIs myself in WS2_32.dll,so i deleted the functions: MyTextOutA,MyTextOutW,
and lines: sm_pHookMgr->HookImport("Gdi32.DLL", "TextOutA", (PROC)CModuleScope::MyTextOutA); sm_pHookMgr->HookImport("Gdi32.DLL", "TextOutW", (PROC)CModuleScope::MyTextOutW);
replaced with sm_pHookMgr->HookImport("WS2_32.DLL","send",(PROC)CModuleScope::MySend);
and i wrote the function MySend.
but it didn't work at all. i don't know why. My system is windows98
help me~~~~. thanks
|
|
|
|
|
Hi
I have two questions
1. Is there any way to retrieve information about toolbar resources (number of buttons, their ID's and images) without loading them into CToolBar object?
2. If look at VS .NET menu (which is actually a toolbar) you can notice that there is a one pixel distance between items, so if you move mouse over it no item will be selected. How it could be done?
________________________
Best regards,
v0id
|
|
|
|
|
Ok, im trying to work with g++ here so i can get used to it. I've written a simple code that uses classes and whatnot. I'm setting variables in the classes using functions like
void myclass::setvariable(int my_variable)
{
Variable = my_variable;
}
Where my_variable is passed into the function and a private variable, Variable, is set equal to it.
This works all fine and dandy in VS.net, however, when compiling in g++, im getting errors. like
Undefined first referenced
symbol in file
This only happens with my g++ compiler, not in VS.net. Any suggestions? Or does g++ not like void functions?
*.*
cin >> knowledge;
|
|
|
|
|
Whats the exact error? Have you included the definition for myclass? Functions returning void are completley standard C/C++, and every compiler (including g++) should handle them
|
|
|
|
|
Here is the error
g++ proj01.cpp
Undefined first referenced
symbol in file
Player::SetFirst(std::string) /var/tmp/ccZLDByc.o
ld: fatal: Symbol referencing errors. No output written to a.out
collect2: ld returned 1 exit status
Here is (part of) my .h file:
#include <string>
#include <vector>
using namespace std;
class Player
{
public:
string GetFirst();
void SetFirst(string first);
private:
string FirstName;
};
Here is my .cpp file for the header...
#include "player.h"
#include <string>
using namespace std;
string Player::GetFirst()
{
return FirstName;
};
void Player::SetFirst(string first)
{
FirstName = first;
};
this only happens with void functions. In GetFirst(), i return a string, and it works fine.
*.*
cin >> knowledge;
|
|
|
|
|
keegan wrote:
#include "player.h"#include using namespace std;string Player::GetFirst(){ return FirstName;};void Player::SetFirst(string first){ FirstName = first;};
Why are you including a semi-colon after the end of each function body in your player.cpp file, you don't need that.
-Nick Parker
|
|
|
|
|
I just tried your example in g++ (GCC 3.2.3), and it compiled and linked just fine (using the following main() ).
#include "player.h"
int main(int argc,char **args) {
Player player;
player.SetFirst("foo!");
return 0;
}
- Mike
|
|
|
|
|
I used my player cpp and h files, with your main, and i got the error:
Undefined first referenced
symbol in file
Player::SetFirst(std::string) /var/tmp/ccF4AOmw.o
ld: fatal: Symbol referencing errors. No output written to a.out
collect2: ld returned 1 exit status
:'(
are you using a new version of g++? i heard that older versions have trouble with void main() things, i wonder if its the same thing here?
Im wondering if its something wrong with the command im entering... Im just putting in "g++ thing.cpp" thing.cpp is my driver (has the main). Do i need to do anything else? I tried a makefile, but it gave the same erorrs.
*.*
cin >> knowledge;
|
|
|
|
|
I just tried it using g++ from GCC 2.95.3, and it still compiled and linked fine, using: g++ -o player player.cpp main.cpp
Very strange... I don't see anything wrong with the code snippets, and it's also weird that it's the linker that's complaining...
- Mike
|
|
|
|
|
yay! i changed absolutely nothing and it works wonderfully now!
yipeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee!
goddamn, unix is just as bad as windows.
Thanks for all your help, i appreciate it a lot.
*.*
cin >> knowledge;
|
|
|
|
|
hi
can you help me about how can i open and read and write in USB port with visualc++ programming ?
thanks alot
|
|
|
|