|
|
Hi,
This is my situation: I have created a project (MFC) which depends on a dll with a lib file (non-unicode). Everything compiles fine (for both debug and release). But I have to build my project again in UNICODE. I have corrected everything for unicode build (as to my source code). I have now a dll and lib file built in unicode. How to I add that dll and lib file to my project? I keep getting unresolved external symbol errors for Debug Unicode and Release Unicode(I think the compiler is looking for a specific function from the dll built in unicode. I would really appreciate it if you could tell me the steps in adding my unicode lib file to the project(not just the simple right click on project and add file, that still doesn't work).
Thanks,
Waxie
-- modified at 23:57 Thursday 19th January, 2006
|
|
|
|
|
|
Thanks for the reply.
Where will be I placing this snippet of code? In what file?
waxie
|
|
|
|
|
|
Another way to do this is to create a separate configuration for unicode debug. In that configuration link your unicode libs and that will work. Similar can be done for Unicode Release.
Regards,
|
|
|
|
|
Hi,
How to convert a .doc,.xls,.pdf etc..file to a CSV file format and then covert it back to .doc,.xls,.pdf file format.
Is there any utility/program available that can be directly integrated into my application for this job? Or Is there any support provided in MFC for the same?
Any Code snippet or function...please help.
your time and help is much appreciated.
Thanks & Best Regards,
Mahesh
|
|
|
|
|
Amarelia wrote: Is there any utility/program available that can be directly integrated into my application for this job?
Have you tried saving the word documents as a RTF file? The excel file can be resaved as CSV (Comma delimited) file? As those are really flat text files CVS should be fine with them and office can still use them (you wont be able to use the fancy formatting of office but it should work).
|
|
|
|
|
S Douglas wrote: Have you tried saving the word documents as a RTF file? The excel file can be resaved as CSV (Comma delimited) file?
That would be the route I'd choose.
"The words of God are not like the oak leaf which dies and falls to the earth, but like the pine tree which stays green forever." - Native American Proverb
|
|
|
|
|
DavidCrow wrote: That would be the route I'd choose.
Sometimes the simplest solution eludes even the best of us. No reason to re-invent the wheel when office is capable of working with the simpler formats. The PDF files now on the other hand well they would be just a pain in the but, unless your running subversion.
|
|
|
|
|
Hello,
I have an unmanaged C++ dll that I would like to load in a managed C++ application. I can call methods in the dll from an *unmanaged* program with no issues.
I set up the import using:
[DllImportAttribute("lib.dll")] int function();
The project is correctly set to find the libary files.
When I run the compiled program, it throws an execption at the line:
function();
The exception is:
An unhandled exception of type 'System.EntryPointNotFoundException' occurred in testManaged.exe<br />
<br />
Additional information: Unable to find an entry point named function in DLL lib.dll.
This error indicates that it cannot find the function in my libarary, but I know the function is there and accessible because I can access it from unmanged code. Is there something wrong with my import statement? Anything else?
Thanks,
--Jordan
-- modified at 23:40 Thursday 19th January, 2006
|
|
|
|
|
Try adding a ExactSpelling=true . I think the syntax would be like this:
<br />
[DllImportAttribute("lib.dll", ExactSpelling=true)] int function();<br />
But I'm not a dotNET guru...
Steve
|
|
|
|
|
The ExactSpelling attribute did not fix it (I get the same exception), but thank you for the suggestion.
--Jordan
|
|
|
|
|
Can you post the declaration of the unmanaged function (so I can check the calling convention) - The C++ code.
Steve
-- modified at 0:06 Friday 20th January, 2006
FIXED errors
|
|
|
|
|
Stephen,
The function was declared as:
LIB_API int function(void);
where I have
#define LIB_API __declspec(dllexport)
Changing it to:
extern "C" LIB_API int function(void);
seems to have fixed the problem -- I'd be happy to hear an explanation for that if you have one.
Thanks,
--Jordan
-- modified at 0:14 Friday 20th January, 2006
|
|
|
|
|
|
I need to develop an exe which runs as an NT Service. My requirement is that I need to spy a folder and encrypt all the new files that come into that folder.
Only the adminstrators should have permissions to stop the service.
I figured out how to spy the folders from code in this site.
Also got the code to run as an NT Service, but could not write an event which on start of NT Service invokes the part to watch directories. And on stop of service unwatches the directory.
Please help me out. Also suggest me how to achieve this if the earlier project in this site could be used.
Ref: http://www.codeproject.com/system/cntservice.asp
Udaybhaskar
|
|
|
|
|
udaybhaskar_nori wrote: lease help me out. Also suggest me how to achieve this if the earlier project in this site could be used.Ref: http://www.codeproject.com/system/cntservice.asp
Mr. Naughter Provided a Demo application with the Service.. where he derived a class from CNTService and created a beeping program.. you have to see code of void CMyService::ServiceMain(DWORD /*dwArgc*/, LPTSTR* /*lpszArgv*/)
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow cheers, Alok Gupta VC Forum Q&A :- I/ IV
|
|
|
|
|
Thanks for your prompt reply.
Yeah I have seen that program. In place of the beep I tried to keep an AfxMessageBox. The service stops responding. Can I write MFC code in that place.
Do I need to call any other method there, before calling MFC code?
Thanks in advance.
Udaybhaskar
|
|
|
|
|
|
|
kakan wrote: A service doesn't have a window so you should avoid all GUI operations, including MessageBox in a service
Little Contradiction Sir, I had placed Dialog Box in the service and it works fine for me.. moreever I have used winsock in that project too.
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow cheers, Alok Gupta VC Forum Q&A :- I/ IV
|
|
|
|
|
udaybhaskar_nori wrote: Yeah I have seen that program. In place of the beep I tried to keep an AfxMessageBox.
You service stop responding because message box have a modal loop!, so you have to respond to MessageBox before interecting with service, Now as Mr. PJ naughter service is not desktop interective by default, you have to make it desktop interective to respond to messagebox and make it messagepump running.
for making Service desktop interective :-
Open Computer Management--> choose Service and Application Tree Item --> choose service tree sub item---> find you service is listed service -> right click on service and choose properties -> now choose LOG ON tab and Check Allow service to interect with desktop check box
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow cheers, Alok Gupta VC Forum Q&A :- I/ IV
|
|
|
|
|
Yes it worked for me that way. But I am getting a lot of debug assetions in debug mode. I am creating a reference to a class and calling a method of that class. What could be the reason? Are there any exceptions in using dialog code.
Udaybhaskar
|
|
|
|
|
udaybhaskar_nori wrote: What could be the reason? Are there any exceptions in using dialog code.
I have read some where you cannot run the Service in debug mode
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
|
|
|
|