|
hello guys...im trying to compile this project but getting this linker error. I have specified all the required include and library files but still it is going into wrong places and showing me the error...here is what is says
LINK : fatal error LNK1104: cannot open file '..\..\..\wrong path\src\debug\file_name.lib
what do I do? thnx
|
|
|
|
|
If that's what it says then it must be looking in that path because of your settings. Check your paths again to make sure you have not inadvertently misplaced one of them.
Just say 'NO' to evaluated arguments for diadic functions! Ash
|
|
|
|
|
I have changed the following paths (VS 2008)........
- Project -> Properties -> C/C++ -> General -> Additional Include Directories(req inc files)
- Project -> Properties -> Linker -> General -> Additional Lib Directories(req lib files)
- Project -> Properties -> Input -> Additional Dependencies (req lib file)
- Tools -> Options -> Project n Sol -> VC++ Directories -> Include file (req incl file)
- Tools -> Options -> Project n Sol -> VC++ Directories -> Library file (req lib file)
now where am i missing something? is there any path still needed?
|
|
|
|
|
I think the above is correct, and just the LIB variables are important, Include directories have no bearing on the Linker. If you look at the log files from your build you should be able to see all the directories in the search order. Your original question suggested that you had a bad path in one of the strings so you also may need to check if one of them contains a variable that refers to your "wrong path".
Just say 'NO' to evaluated arguments for diadic functions! Ash
|
|
|
|
|
Hi there,
I have to fill CImageList with bitmaps. Each bitmap represent a flag of a country.
To do this one normally adds the bitmap files as resource, then :
CImageList allFlagsList;
CBitmap flagUSA;
flagUSA.LoadBitmap(IDFlagUSA);
allFlagsList.Add(flagUSA);
CBitmap flagFrance;
flagFrance.LoadBitmap(IDFlagFrance);
allFlagsList.Add(flagFrance);
..etc
Of course it becomes tedious to do this for all flags ( actually I already did it but want to refactor it for sake of my code!).
However I can't find a way how to load a bmp image directly into a CBitmap object.
Anyone knows ?
Thanks in advance.
Push Framework - now released !
http://www.pushframework.com
|
|
|
|
|
I'm not sure I understand your question, but if you are trying to load a bitmap from a file you can use LoadImage()[^].
Just say 'NO' to evaluated arguments for diadic functions! Ash
|
|
|
|
|
Thx for your will to help.
That's what I was relying on, but this way I needed to get all flags in the resources which was tedious.
I found this which solves my issue and maybe the one who would encontere the same situation :
http://www.codeguru.com/cpp/g-m/bitmap/article.php/c1707
Push Framework - now released !
http://www.pushframework.com
|
|
|
|
|
Hey guys,
I am trying to fetch the data from here ->
http://74.54.176.106/whois/whois.cgi?domain=127.0.0.1[^]
Though I am not receiving everything, this is all I get:
<HTML&gt;
&lt;HEAD&gt;
&lt;TITLE&gt;Global Whois : whois 127.0.0.1
Tried to google but couldn't find anything that helped me.
my code:
char buffer[4096];
char strRequest[] = "GET /whois/whois.cgi?domain=127.0.0.1 / HTTP/1.0\r\n\r\n";
send(sock, strRequest, sizeof(strRequest), 0);
int i = recv(sock, buffer, sizeof(buffer), 0);
modified on Friday, November 26, 2010 11:49 AM
|
|
|
|
|
Please try to correct the "code block" so readers can understand.
You supplied a buffer length that good enough.
However you should note that the socket :recv API does not garantee to you the receipt of all incoming data at once.
You must loop on that function untill either the peer server closes the connection (I think you will get a -1 return value from recv)
or until you know that you received what you "want" ( can only be done if you decode and interpret data at same time ).
Let me suppose that you are talking to a peer webserver, so we know that when all data is sent, the server immediately closes the connection. In that case, your code
should be like this :
char buffer[4096];
int offset = 0;
while ( true )
{
int i = recv(sock, buffer+offset, sizeof(buffer)-offset, 0);
if(i != -1){
offset += i;
else
break;
}
It is the same thing with the ::send API. You can not garantee that all passed data will be sent. In both cases the system will give you the count of what it managed to process.
Of course you can help avoid these complexities but just using an existing library.
Hope this helps.
Push Framework - now released !
http://www.pushframework.com
|
|
|
|
|
Thanks, I got where you are coming from.
Unfortunately the connection doesnt close, it just sits there.
Tried sending
char strRequest[] = "GET /whois/whois.cgi?domain=127.0.0.1 HTTP/1.0\r\nConnection: Close\r\n\r\n";
but nothing.
Can you suggest me an already existing library that isn't as huge as curlpp or boost, or generally one that is somewhat easy to handle?
I am still new to c++ as you may know.
modified on Friday, November 26, 2010 12:13 PM
|
|
|
|
|
Use Poco C++. I used it before eventhough I personaly did not touch the network library of it. (consists of 3 dlls maybe you just need the network one only).
If I remember well there was a class called HttpClient so it will automatize your task.
There are test suites as well so you can figure how things are being used and even take your decision of whether to use the library or not.
http://pocoproject.org/
Push Framework - now released !
http://www.pushframework.com
|
|
|
|
|
You need to study the rules of sockets. A recv() call will only return the amount of data that is currently available on the socket. You must continue to receive data until you get the end of the transmission (I cannot remember the last piece of an HTTP message, but I'm sure you can Google it). Don't just assume you will get the entire message in one go.
Just say 'NO' to evaluated arguments for diadic functions! Ash
|
|
|
|
|
Hello people.
I have a tooltip-like system that shows up information in a popup window based on where the mouse cursor points. Works fine most of the time, but when there's a message box or other modal dialog popping up because of certain events hapening in the background, the tooltip windows just stays on the screen. I guess this is because once the parent window containing the control that has the tooltips is deactivated/disabled (because of the modal dialog), it no longer receives any mouse messages thus the "tooltip" will think that the mouse is still pointing at the given location (since there's no WM_MOUSEMOVE, no WM_MOUSELEAVE...). I used the usual mouse messages (WM_MOUSEMOVE, WM_LBUTTONDOWN...) along with TrackMouseEvent[^] to know when and what to show and hide. But i don't know how to handle the case when we no longer receive any mouse input. One way i guess would be to handle WM_ACTIVATE in the parent window and then channel the event towards the child that has the tooltips but this seems to be quite a non-portable and ugly solution. So anyone knows how to do this right?
> The problem with computers is that they do what you tell them to do and not what you want them to do. <
> Leela: Fry, you're wasting your life sitting in front of that TV. You need to get out and see the real world.
Fry: But this is HDTV. It's got better resolution than the real world <
|
|
|
|
|
Hi there,
So what about just intercepting the event of when that parent window gets de-activated because of the pop-up and force to tooltip to disappear ?
You may thus look for WM_ACTIVATE event. Its handler gives a state parameter by which you know if your window is being activated or deactivated, and in the second case it can even give you the address of the "guilty" window (the popups in your case)
Push Framework - now released !
http://www.pushframework.com
|
|
|
|
|
As i said, that is one option, it just seems a bit...ugly. Having to do that for every "parent" window everywhere you want to use this tooltip thing isn't convenient.
> The problem with computers is that they do what you tell them to do and not what you want them to do. <
> Leela: Fry, you're wasting your life sitting in front of that TV. You need to get out and see the real world.
Fry: But this is HDTV. It's got better resolution than the real world <
|
|
|
|
|
Sorry I looked to your message rapidly, not paying attentio,n to your last sentence.
Well, I do'nt thiink it is too ugly. By the way, you are already calling your tooltip from within the parent frame, in order to achieve things like the tooltip fades away when mouse leaves the control area, no ?
I honestly can't see something else. I had this pbm before with Pustovoy' tooltip when popus are triggered by hyperlinks on the tooltip themselves.
Push Framework - now released !
http://www.pushframework.com
|
|
|
|
|
No, i use TrackMouseEvent[^] to detect when the mouse leaves. Guess i'll have to go with the activation "relaying" then. Thanks for your help.
> The problem with computers is that they do what you tell them to do and not what you want them to do. <
> Leela: Fry, you're wasting your life sitting in front of that TV. You need to get out and see the real world.
Fry: But this is HDTV. It's got better resolution than the real world <
|
|
|
|
|
void getPath(LPSTR lpszPath)
{
CFile file;
char pbuf[512];
...
file.Read(pbuf, size);
}
So what can I do to manage it?
Maybe what has confused me is the different string data types....
|
|
|
|
|
It is the same as if you were dealing with char* !
Have the habit of discovering what the definition of an unknwon type to you is. In this case you'll find it's just made from a typedef !
typedef CHAR *LPSTR;
Push Framework - now released !
http://www.pushframework.com
|
|
|
|
|
|
LPSTR is a char*
typedef char* PSTR, *LPSTR;
|
|
|
|
|
|
#include "stdafx.h"
#include <iostream>
#include "afx.h"
using namespace::std;
void getPath(LPSTR lpszPath, int max)
{
char pbuf[512];
LPCTSTR lpszFileName = _T("1.txt");
CFile mFile(lpszFileName, CFile::modeRead | CFile::shareCompat);
if(mFile.GetLength() < 2)
return;
mFile.Read(pbuf, 500);
mFile.Close();
memcpy(lpszPath, pbuf, 500);
}
int _tmain(int argc, _TCHAR* argv[])
{
LPSTR lpstr = new char[2000];
memset(lpstr, 0, 2000);
getPath(lpstr, 2000);
return 0;
}
我爸是李刚
|
|
|
|
|
thx for your detailed example
|
|
|
|
|