|
Falconapollo wrote: Cannot open include file: 'e:\work\t\czsj\excel.cpp': No such file or directory
The text of the error message is perfectly clear and tells you that the file excel.cpp cannot be found at that path. Why are you trying to include a source (.cpp) file in this way; you should add the file to your project (directly or indirectly) and build it as normal.
|
|
|
|
|
The compiler will never search for cpp files, you have to add them explicitly to your project, see the solution pane. Either create them inside your project, or add them ("Add Existing Item") if they already exist.
The one thing that gets looked for is header files (*.h), that is what all the "include" commands and directives are for.
|
|
|
|
|
Hi everybody
How can I send/receive SMS in c++(with PC) with a GSM Modem?
Is it possible?
Can I use MAPI for this?
www.logicsims.ir
|
|
|
|
|
|
Thanks a lot
I've read most of them already
I hope I can find a way with windows API, not sending AT command.
Regards
www.logicsims.ir
|
|
|
|
|
If you use a terminal such as hyper teminal you can practise with the AT commands you need to send SMSs. Once you have got these tuned, then you can put those strings into a C++ app (all it is going to do is send these strings to an opened COM port, as hyperterminsl does).
I wrote a driver some years back that does this, it isnt terribly difficult once you get the AT commands sorted out.
By the way, you must terminate the string in some kind of a carriage return, '\r' or '\n'. It is this that tells the AT processing engine in the modem to actually send the string, this could be what you are missing.
==============================
Nothing to say.
modified 10-Oct-11 3:03am.
|
|
|
|
|
Hi
Thank you,I will try it
Regards
www.logicsims.ir
|
|
|
|
|
hello guys... I have got a project online. Now this project contains a function whose return type is LRESULT. Function's prototype and body are given as under.
afx_msg LRESULT FunctionName(WPARAM wParam, LPARAM lParam);
LRESULT ClassName::FunctionName(WPARAM wParam, LPARAM lParam)
{
}
But the problem is, I dont know how to add these sort of functions in application? Thanx for any help.
modified 8-Oct-11 2:42am.
|
|
|
|
|
overloaded Name wrote: I dont know how to add these sort of functions in application?
Just add the code into one of your source files where you need to use it. In the case of class functions you would add the prototype to the class definition in the header file and the body to the class source file. The sample code from any Visual C++ project will show you how to do it.
|
|
|
|
|
Hi all,
I want to make a priviewer in my application. i have also found a article on code project to preview files but it only priview files which have priview handler installed in registry, so it only preview word, excel files(i.e office Files). i want to priview all other files which are able to generate their priviews in windows priviewer pane. How can i do it.
Thanks in advance
|
|
|
|
|
If the files do not have an attached/attachable previewer then you will have to write your own, by creating some sort of view of the file content and rendering it to a bitmap which you can then display at whatever scaling you wish.
|
|
|
|
|
Actually i am not getting how to do it, so can you please tell me, how can i do this...
|
|
|
|
|
I thought I did! If there is no built in preview for a type of file then you will have to create one for yourself. This would involve writing handlers for every type of file that you encounter and rendering a view of their content as some sort of image.
|
|
|
|
|
VCProgrammer wrote: I want to make a priviewer in my application.
Is it an MFC application?
"One man's wage rise is another man's price increase." - Harold Wilson
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
"Show me a community that obeys the Ten Commandments and I'll show you a less crowded prison system." - Anonymous
|
|
|
|
|
yes it is a MFC application.
|
|
|
|
|
If it was an SDI or MDI application, you had the option of Print/Print Preview when you created it. If you opted out of that, it can easily be added back in. Create another "test" application and make sure the Print/Print Preview option is checked. Once the application is created, look at the code that is specific to Print/Print Preview. That's what you'll need to add to your application.
"One man's wage rise is another man's price increase." - Harold Wilson
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
"Show me a community that obeys the Ten Commandments and I'll show you a less crowded prison system." - Anonymous
|
|
|
|
|
extern DWORD mainThreadId;
PostThreadMessage(mainThreadId,WM_MESSAGE_THREAD,0,0);
I used this code to post a message from running thread to the main thread.
The message gets "intercepted" in the application class
BOOL CFD2008App::PreTranslateMessage(MSG* pMsg)
I does not get intercepted using same PreTranslateMessage in CMainFrame.
Now I need to run a process in CFD2008View.
How do I get the message there? All this in MFC.
Any constructive help will be as always appreciated.
Thanks Vaclav
|
|
|
|
|
When creating[^] the thread pass the CView pointer using the pParam parameter to the thread. In the thread use this pointer to post messages to the view.
0100000101101110011001000111001011101001
|
|
|
|
|
Andre,
thank you for your suggestion.
I have passed the view pointer to the new thread and can use it to read edit box text directly, without sending message.
However, I need to control the cursor in this edit box, using SetSel, and it does not work right now.
I think I can figure it out.
It seem that posting messages using PostThreadMessage is an iffy proposition. The documentation said that if it does not work use Sleep and try again.
It seems to work in bebug / stepping thru the code mode.
I cannot do that since my goal is to move edit box cursor along when the characters are output. I am sending Morse code and however slow it is in comparison with other data, I cannot see using Sleep.
Anyway, you suggested to pass a pointer to view, however, all MFC Post/Send messages need a thread ID. Is that correct?
But since I am not going to use messages, it is irrelevant for now.
Thanks for you help.
Vaclav
|
|
|
|
|
Vaclav_Sal wrote: however, all MFC Post/Send messages need a thread ID. Is that correct?
No, that is not correct. Usually all you need is the HWND handle of the window that is to recieve the message. See here[^] and here[^].
Independent ACN Business Owner- Check out the possibilities for your future!
- Financial independance
- Full time or Part time
- In more than 20 countries through North America, Europe, Asia and the Pacific
- Featuring the ACN IRIS 5000 video phone. See the person you are talking to.
Within you lies the power for good - Use it!
|
|
|
|
|
Do not directly interact with the GUI from your worker thread, you may get into deadlock situations. Although it is more work only interact by using PostMessage[^].
Read this article Using Worker Threads[^] for some detailed information.
0100000101101110011001000111001011101001
|
|
|
|
|
OK, you have convinced me that PostMessage to the main thread view is the way to handle this.
Now the MFC question
Which is preferred / proper way to intercept the message in MFC ?
Using ON_THREAD_MESSAGE ( probably not since this is PostMessage not PostThreadMessage ) or WindowsProc or PreTranslateMessage?
Actually I really would like to know what is the hierarchy/sequence of theses functions in the CView class.
Many thanks for all your inputs, I appreciate it.
|
|
|
|
|
You will be using user defined messages for your communication.
Have look at this article Message Management[^] on how to make your own messages.
0100000101101110011001000111001011101001
|
|
|
|
|
Typical - after I learn the rules (WM_USER) they change them!
Looks like registered messages and ON_ whatever in approprite
message queue is the ticket.
Thanks for all your help.
|
|
|
|
|
Your welcome.
0100000101101110011001000111001011101001
|
|
|
|