|
hi
i want to write a DLL that using header from libyahoo2(http://www.libyahoo2.sourceforge.net)
here is the code snipets
==========================================================================
#include "stdafx.h"
#include <libyahoo\yahoo2.h>
#include <libyahoo\yahoo2_callbacks.h>
//function declaration
extern "C" __declspec(dllexport) void __cdecl Close(int id);
BOOL APIENTRY DllMain( HANDLE hModule,
DWORD ul_reason_for_call,
LPVOID lpReserved
)
{
return TRUE;
}
__declspec(dllexport) void __cdecl Close(int id)
{
yahoo_close(id);
}
======================================================================
when i compile this dll project, i've got no error
but when i execute this project i've got 2 error said:
======================================================================
Linking...
Creating library Debug/YahooLib.lib and object Debug/YahooLib.exp
YahooLib.obj : error LNK2001: unresolved external symbol _yahoo_close
Debug/YahooLib.dll : fatal error LNK1120: 1 unresolved externals
Error executing link.exe.
YahooLib.dll - 2 error(s), 0 warning(s)
=====================================================================
please helppp me, i am really don't know what to do
i appreciate any help
thankss
|
|
|
|
|
xeru_slash wrote:
but when i execute this project i've got 2 error said:
Actually you are getting a linker error, not a runtime error.
xeru_slash wrote:
YahooLib.obj : error LNK2001: unresolved external symbol _yahoo_close
You need to link with the library that contains the code for _yahoo_close() .
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
|
|
|
|
|
thanks for your reply
but there is no lib files
only header and c file
|
|
|
|
|
|
xeru_slash wrote:
but there is no lib files
My bad for making that assumption. At a minimum, you'll need to link with the .obj file that has that function in it.
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
|
|
|
|
|
Can anyone help me develop sum small software using MFC, having sock classes and database classes ( such as Ms Access ) ? any examples or links will be appreciated.
Blacknight_81
University of Huddersfield, UK.
|
|
|
|
|
Why don't you start the planning yourself and ask us a more precise question?
"Do my homework for me!" is very unpopular!
Don't try it, just do it!
|
|
|
|
|
|
My application must add and remove some pages from a CPropertySheet in the middle of the "modal loop" (for instance, when the user clicks a button...)
The problem is the CPropertySheet does not resize to fit the newly added pages except when these are added before the call to DoModal()...
Can anybody figure a way to resize the CPropertySheet suitably?
tks
Bruno Norberto
|
|
|
|
|
I create object from remote machine, as dll in a surrogate,
within it I
register IUnknown in a ROT with Register active object,
than, I call from else process on same remote machine GetActiveObject with same guid -
(guid - is created by me!)
but receive exception of unknown type catch(...)
what is the prolem can it be?
thanks you.
|
|
|
|
|
I have designed a tool using MDI application...
In each MDI child window i have drawn objects like square,circle and other figures.
I would like to know if these can be saved and reloaded on starting the application afresh.
I havent used serialization but will it reproduce the graphical objects drawn in the client area of the window.
laiju
|
|
|
|
|
Serialization would be the keyword, thats your way to store the info to recreate all the figures.
I'm sure there are articles about that on CP.
Don't try it, just do it!
|
|
|
|
|
how do i have some text displayed next to the button when the mouse is over the button? just like the alt function of html code.
this is for displaying the function of the button. anyone pls help? thanks a lot!
|
|
|
|
|
|
|
Hello, I posted this problem yesterday and it didn't get any responses so I figured I would try it on more time... I have a MDI type app where one of my views was derived from CView and then converted into CRichEditView...
Anyway everything works fine except I want to turn horizontal scrolling on and I would like to disable word wrapping. I have tried to change the window styles in PreCreateWindow but this doesn't seem to have any effect on horizontal scrolling. Any ideas? Has anyone had similar experiences?
Thanks,
Rob
Whoever said nothing's impossible never tried slamming a revolving door!
|
|
|
|
|
I just figured it out.. Incase anyone else runs into this....
Inside OnInitialUpdate()
m_nWordWrap = WrapNone;
WrapChanged();
Inside PreCreateWindow
cs.style += ES_MULTILINE | WS_VSCROLL | ES_AUTOVSCROLL | ES_LEFT | ES_AUTOHSCROLL | WS_HSCROLL;
Whoever said nothing's impossible never tried slamming a revolving door!
|
|
|
|
|
hiho@ll
i know this site is for windows programming, but i just wanted to know if my C-Code could have a problem, and this website is very well visited i think
for those who also use linux:
i'm coding on a suse linux box with kernel 2.4.21-226-default running gcc v 3.3.1
the problem is a function named strtok
which tokenizes my string using a delimiter
char test[]="hallo hallo2";
z.B. first call strtok(test," "); // returns hallo
seconde call strtok(NULL," "); // returns hallo2
this code works!:
char str[] ="This is a sample string,just testing.";
char * pch;
printf ("Splitting string \"%s\" in tokens:\n",str);
pch = strtok (str," ");
while (pch != NULL)
{
printf ("%s\n",pch);
pch = strtok (NULL, " ,.");
}
this code doesn't work! (i get a segmentation fault):
char *str ="This is a sample string,just testing."; // just changed char[]
char * pch;
printf ("Splitting string \"%s\" in tokens:\n",str);
pch = strtok (str," ");
while (pch != NULL)
{
printf ("%s\n",pch);
pch = strtok (NULL, " ,.");
}
could there a problem with the code itself?
what's the difference between pointers and arrays?
i thought there is no difference!
thx@ll
|
|
|
|
|
strtok() actually modifies the source string. That's why str[] works and str* does not.
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
|
|
|
|
|
??
1. is there a difference?
char *str="hello";
str[0]='z';
--> str = "zello";
char str[]="hello";
str[0]='z';
--> str = "zello";
so what's the difference
and function header looks like this:
char *strtok(char *s, const char *delim);
2. str* doesn't work and str[] works! and not the other way, like u said
thx
|
|
|
|
|
ThinkingPrometheus wrote:
1. is there a difference?
Yes.
http://www.eskimo.com/~scs/C-faq/s6.html
ThinkingPrometheus wrote:
and function header looks like this:
char *strtok(char *s, const char *delim);
Since the first parameter is not const , that indicates it can/will be modified.
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
|
|
|
|
|
you wrote: strtok() actually modifies the source string. That's why str[] works and str* does not
look at my example prog!!!!
it works the other way!
str* doesn't work and str[] works! why?
thx
|
|
|
|
|
ThinkingPrometheus wrote:
you wrote: strtok() actually modifies the source string. That's why str[] works and str* does not
look at my example prog!!!!
it works the other way!
I think you need to re-read this thread. Your code indicates that char[] works but char* does not. Now you state that it works the other way.
The strtok() function works as it is intended to. Read its documentation. I provided you a link that explains the difference between a pointer and an array. Please read it.
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
|
|
|
|
|
i read the doc of strtok and your link
but it confuses me more than before
much more i'm asking why it doesn't work
cause strtok wants a pointer
i give it a pointer it makes segmentation fault
i give it an array it works!!!???
shouldn't it work if i give it a pointer and it wants a pointer!?
*confused*
|
|
|
|
|
Because when you write:
char* s = "hello"; the compiler/linker may allocate read-only memory for that string, and set s to the address of that memory. Thus when you try and modify that string, it segfaults.
--Mike--
Visual C++ MVP
LINKS~! Ericahist | 1ClickPicGrabber | CP SearchBar v2.0.2 | C++ Forum FAQ
Strange things are afoot at the U+004B U+20DD
|
|
|
|