|
get this error for 133 times:
CxImage.lib(ximajpg.obj) : error LNK2019:unresolved external symbol "_jpeg_finish_decompress" in Function ""public: bool __thiscall CxImageJPG::Decode(class CxFile *)
"(?Decode@CxImageJPG@@QAE_NPAVCxFile@@@Z)".
followed by fatal error LNK1120
Please help, i have tried to search in google but no way .
|
|
|
|
|
Looks like you missed to link some required library. Have you read about all CxImage requirements?
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
Did you import a lib file to your project?
|
|
|
|
|
I do have a wicked anomaly regarding an "out of memory" situation which behaves differently in two of my applications.
Application 1, let it be called "tool", is an inhouse tool, MFC based with full MFC GUI and stuff.
Application 2, let it be called "client", is a multiplayer game client, using MFC but only for the network socket, the whole GUI being custom on top of OpenGL/DirectX.
Both applications are made with Visual C++ 2003.NET / v7.1.6030 unter WindowsXP. Only the "Release" mode is currently used.
For exception handling of win32 exceptions both have the following project properties set...
Project Properties -> C/C++ -> Code Generation -> Enable C++ Exceptions = No
Project Properties -> C/C++ -> Command Line = /EHa
...plus...
_set_se_translator(myfunction)
...is used (based on the information I found here[^]).
But the wicked thing comes with memory allocation and the throwing vs. not-throwing of a std::bad_alloc exception. If I put the following code into both applications...
Byte* pData = NULL;
try {
int Amount = 0;
--Amount;
pData = new Byte[Amount];
}
catch (std::bad_alloc& E) {
}
...they behave differently:
The "tool" behaves as I would expect and a std::bad_alloc exception is thrown, catched and my own error handling does the rest.
But in the "client" a Windows message box comes up, simply telling me "Out of memory." with a black exclamation mark in a yellow triangle plus an OK button and if I press the OK button the application continues to run - which actually gives me a big "WTF?" moment. One way or the other that behaviour is neither intended nor appreciated.
My best guess is that it depends on the compiler settings but I wasn't able yet to find any meaningful differences. I already experimented with optimization levels but couldn't change the application's behaviour doing so. Could anybody give me a hint on what the problem might be?
Thanks,
T.T.H.
|
|
|
|
|
Answering myself:
Both applications seem to use different implementations of the new operator - despite both using the MFC:
Application 1 uses the one from the CRT and throws a std::bad_alloc exception.
Application 2 uses the one from the MFC and throws a CMemoryException*.
According to "Binglong's Blog" (link see below) the actual choice which new operator will be used depends on (quote) "the operator new comes from the library the linker sees first". Ugh. What a mess. Unfortunately I was not able to define myself what "the linker sees first". If somebody has a handy hint, go ahead, will be very apprectiated!
In addition to that there seems to appear some "Microsoftic Magical Trick": in case a CException is thrown ""somebody"" checks whether it will be catched - if yes, it the exception will be thrown, if not, the application will not simply crash but a message box will be displayed and the application can run on. Please note that this is an assumption based on my observation and to be honest I don't consider it helpful to wastespend more time on examining that behaviour further.
Helpful links:
Binglong's space: Operator new, STL memory allocator, and MSVC[^]
Visual C++ 6.0: Don't Let Memory Allocation Failures Crash Your Legacy STL Application[^]
Visual C++ exception handling[^]
|
|
|
|
|
I know! I've posted this once before, but I didn't get my answer. Sorry! I'm quite new and I know this may seems funny; But the problem is:
I wanna send a file to a given eMail address "without displaying any dialog box from STRANGER applications like outlook express or anything".
Frankly speaking, I don't wanna fall into reading boring APIs So could you please direct me to a
free source or an utility or somethig ...
Thank you masters!
|
|
|
|
|
I'm not a great expert, but maybe this article can help:
http://www.codeproject.com/KB/IP/zsmtp.aspx[^]
You'd need to get the basic information (server name) at some point though. But I don't think I'd like an application that was completely stealthily sending emails from me. Who know what they could be saying? I'm sure you are an angel who spends all winter bringing the homeless blankets and dinner [*], but not all people are...
Iain.
[*] Beer smiley to anyone who gets the song quote (without google)
|
|
|
|
|
I feel kind of misunderstanding into your words. Any way I thank you for your attention.
For You ----->
Thank you masters!
|
|
|
|
|
Okay:
Jusef Marzbany wrote: I've posted this once before, but I didn't get my answer. Sorry!
Impatient/ungrateful (perhaps you should be more clear?)
Jusef Marzbany wrote: "without displaying any dialog box from STRANGER applications like outlook express or anything"
Bolding to try and get people's attention (is likely to do the opposite )
Jusef Marzbany wrote: Frankly speaking, I don't wanna fall into reading boring APIs
Lazy.
Hmm.. Looks like you should read the forum posting guidelines and do some work yourself
Regards,
--Perspx
"I've got my kids brainwashed: You don't use Google, and you don't use an iPod." - Steve Ballmer
"Some people have told me they don't think a fat penguin really embodies the grace of Linux, which just tells me they have never seen an angry penguin charging at them in excess of 100mph." - Linus Torvalds
|
|
|
|
|
Answer me if you can, if not your're not forced to say nonsense
Thank you masters!
|
|
|
|
|
I don't think it's nonsense - it may help you to get answers to your questions in the future more easily; you're not forced to listen to my "nonsense" either; I just thought it may be of use.
Regards,
--Perspx
"I've got my kids brainwashed: You don't use Google, and you don't use an iPod." - Steve Ballmer
"Some people have told me they don't think a fat penguin really embodies the grace of Linux, which just tells me they have never seen an angry penguin charging at them in excess of 100mph." - Linus Torvalds
|
|
|
|
|
I beg your pardon, I was angry with someone ...
Thank you masters!
|
|
|
|
|
Jusef Marzbany wrote: Answer me if you can
Actually his post is a valid answer.
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
I beg your pardon, I was angry with somebody ...
Thank you masters!
|
|
|
|
|
We have developed one IOCP server Application.
We got a socket close event when client application (safe/unsafe) close.
But when client machine restarts or network cable unplugged we can not get
any event of the socket close.
We have also tried to set socket timeout with setsockopt() ,but its not working with IOCP.
So ,Is there any method to get close event for this sockets? or any other method to set
timeout in IOCP.
Thank you.
|
|
|
|
|
What is an "IOCP server Application"?
Mark
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
No, IP is not a 'connected' protocol, it just maintains connection state on each side. This is usually considered a feature as it allows recovery from temporary disconnects.
A common solution is to add a heart-beat message to your protocol that the server sends to the client. The heart-beat message basically says 'hey, are your still there? if so please respond to this'. If the client doesn't respond in a timely manner it is assumed that the connection is broken.
See: http://tangentsoft.net/wskfaq/newbie.html#abnormalclose[^]
...cmk
The idea that I can be presented with a problem, set out to logically solve it with the tools at hand, and wind up with a program that could not be legally used because someone else followed the same logical steps some years ago and filed for a patent on it is horrifying.
- John Carmack
|
|
|
|
|
Hi to all.
I have an app which opens Personal Address Book using MAPI. I display info about contacts.
My problem is that I can't get to display business fax number, other properties like display_name is properly shown but fax not. I use virtual CListCtrl to display info, my code is as follows:
after all needed calls to Initialize,Logon,Getting PAB and so on..
LPSPropValue lpDN = PpropFindProp(lpRows->aRow[0].lpProps,lpRows->aRow[0].cValues,PR_BUSINESS_FAX_NUMBER);
lpDN != NULL ? l_strText = lpDN->Value.lpszA : l_strText="";
if(!lpDN)
{
lpDN = PpropFindProp(lpRows->aRow[0].lpProps,lpRows->aRow[0].cValues,PR_BUSINESS_FAX_NUMBER_W);
lpDN != NULL ? l_strText = lpDN->Value.lpszW : l_strText="";
}
if(!lpDN)
{
lpDN = PpropFindProp(lpRows->aRow[0].lpProps,lpRows->aRow[0].cValues,PR_BUSINESS_FAX_NUMBER_A);
lpDN != NULL ? l_strText = lpDN->Value.lpszA : l_strText="";
}
in all this cases my lpDN is NULL!
Why is this happening?
I know my contact has business fax number!
|
|
|
|
|
I'm wondering why nobody replied to my question is it not clear of what?
I would be more than grateful for a suggestion of any kind. I could share more info on this if someone is interested.
This problem is annoying me for days so please help.
Thanks.
|
|
|
|
|
Like virtual memory, when read/write the memory,
if the page is in the memory, there will be little extra overhead .
And if the page is not in the memory, the program will deal with the page fault,
and jump back to re-run the operation that generate the page fault.
Now I'd like to apply this to cache implementation,
I suppose the cache always contains what should be cached.
So if the data is in the cache, it'll run smoothly.
If not, it can jump to prepare the cache and jump back to re-run.
PS: I need this because the cache in my application is the intermediate calculation result,
and it'll be saved in the database for future use (in other words,
it need to be cached only once, so the program runs as smoothly as possible most of the time)
Any good skill to simulate this?
More local variables mean higher cohensive
Less function parameters mean looser coupling
modified on Wednesday, September 24, 2008 10:14 AM
|
|
|
|
|
I m new to VC++ , I have a vc++ mfc application which i want connect with MySQL database.. earlier it dont have any database connectivity. Can anybody guide step by step to connect it to databse. I have installed MySQL 5 on my system n also installed MySQL connector 5.1 .
In my application , added these two lines of code
#include "afxdb.h"
then in a function void OnClickOk()
{
CDatabase db;
int i;
db.OpenEx(_T("Driver={MySQL ODBC 5.1 Driver};Server=localhost;Database=kcc_trades; User=kats;Password=db_logon;Option=3;"));
i = db.IsOpen();
}
but it gives the errors
error C2065: 'CDatabase' : undeclared identifier
1>.\ChangeLimitsForm.cpp(574) : error C2146: syntax error : missing ';' before identifier 'db'
1>.\ChangeLimitsForm.cpp(574) : error C2065: 'db' : undeclared identifier
1>.\ChangeLimitsForm.cpp(576) : error C2228: left of '.OpenEx' must have class/struct/union
1> type is ''unknown-type''
1>.\ChangeLimitsForm.cpp(577) : error C2228: left of '.IsOpen' must have class/struct/union
1> type is ''unknown-type''
and if I put the cursor on CDatabse db; then it shows CDatabase as class and cursor on db shows CDatabase db means memeber ...... also db. shows me the list of available function from which I selected OpenEx....... i mean to say that it identifies CDatabase as class then why it is giving error....
Can anybody help me!!!!!!!!!!
Please I m struggling with these from the last one week.......
thanks
|
|
|
|
|
Are you sure that you included afxdb.h in the right source file (i.e. the one the compiler is complaining about the missing declaration)?
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
param_joshi wrote: error C2065: 'CDatabase' : undeclared identifier
You must #include "afxdb.h" as Carlo already pointed out.
param_joshi wrote: Please I m struggling with these from the last one week.......
Gladly you at least tried to resolve it instead of posting urgnz queries.
Many are stubborn in pursuit of the path they have chosen, few in pursuit of the goal - Friedrich Nietzsche
.·´¯`·->Rajesh<-·´¯`·.
[Microsoft MVP - Visual C++]
|
|
|
|
|
Yes, i have included "afxdb.h" in the same source file at top and then in the same source file i wrote CDatabase db; when I use this object db and put a dot db. it shows me a list of member function which means it is recongnizing the db object and listing all member functions of the class CDatabase.... but when i compile the source file cntrl+f7 then it gives all the errors...
|
|
|
|
|
If afxdb.h is included, there is no way for this error to pop up. Just verify it again - there's a chance that the file is actually not being included? Wrong path specified for the header files?
Many are stubborn in pursuit of the path they have chosen, few in pursuit of the goal - Friedrich Nietzsche
.·´¯`·->Rajesh<-·´¯`·.
[Microsoft MVP - Visual C++]
|
|
|
|