 |
 |
Apologies for the shouting but this is important.
When answering a question please:
- Read the question carefully
- Understand that English isn't everyone's first language so be lenient of bad spelling and grammar
- If a question is poorly phrased then either ask for clarification, ignore it, or mark it down. Insults are not welcome
- If the question is inappropriate then click the 'vote to remove message' button
Insults, slap-downs and sarcasm aren't welcome. Let's work to help developers, not make them feel stupid.
cheers,
Chris Maunder
The Code Project Co-founder
Microsoft C++ MVP
|
|
|
|
 |
For those new to message boards please try to follow a few simple rules when posting your question.- Choose the correct forum for your message. Posting a VB.NET question in the C++ forum will end in tears.
- Be specific! Don't ask "can someone send me the code to create an application that does 'X'. Pinpoint exactly what it is you need help with.
- Keep the subject line brief, but descriptive. eg "File Serialization problem"
- Keep the question as brief as possible. If you have to include code, include the smallest snippet of code you can.
- Be careful when including code that you haven't made a typo. Typing mistakes can become the focal point instead of the actual question you asked.
- Do not remove or empty a message if others have replied. Keep the thread intact and available for others to search and read. If your problem was answered then edit your message and add "[Solved]" to the subject line of the original post, and cast an approval vote to the one or several answers that really helped you.
- If you are posting source code with your question, place it inside <pre></pre> tags. We advise you also check the "Encode HTML tags when pasting" checkbox before pasting anything inside the PRE block, and make sure "Ignore HTML tags in this message" check box is unchecked.
- Be courteous and DON'T SHOUT. Everyone here helps because they enjoy helping others, not because it's their job.
- Please do not post links to your question in one forum from another, unrelated forum (such as the lounge). It will be deleted.
- Do not be abusive, offensive, inappropriate or harass anyone on the boards. Doing so will get you kicked off and banned. Play nice.
- If you have a school or university assignment, assume that your teacher or lecturer is also reading these forums.
- No advertising or soliciting.
- We reserve the right to move your posts to a more appropriate forum or to delete anything deemed inappropriate or illegal.
cheers,
Chris Maunder
The Code Project Co-founder
Microsoft C++ MVP
|
|
|
|
|
|
 |
I want to make a log with errors during the execution of my app. I'm trying to write an event to the windows Event Viewer with a VCL form application with C++ Builder XE5.
I'm using Vcl.SvcMgr.TEventLogger class.
The code in the header file is :
TEventLogger *Event;
The code in the cpp file is :
Event=new TEventLogger("MySource");
Event->LogMessage("MyMessage");
But beside my message, in the error description in the Event Viewer there is a message : "The description for Event ID 0 from source MySource cannot be found. Either the component that raises this event is not installed on your local computer or the installation is corrupted." . How can I remove that description and write only the message that I want? Should I be using other C++ class? I couldn't find any documentation about this class. The idea of using Event Viewer is that when the application is running on an user with restricted rights he won't be able to write to files, meaning I can't just type into a ".txt" file. If anyone else has a different idea how to make a log with errors, please share!
|
|
|
|
 |
If I remember corrctly, you don't pass the message to Event Viewer directly, but you pass an application name and message id. You need a DLL that contains the texts to the ID (don't ask me in what format). And you need a specific registry key (in local machine I think) pointing the Event Viewer to the path of the DLL. We also used this approach long ago in one of our applications but aren't using it anymore because it's so complicated.
I would suggest the user needs to at least one directory where he/she has write permission. You could then enter the directory into some kind of ini file, read it on application start and write the log file into that directory.
The good thing about pessimism is, that you are always either right or pleasently surprised.
|
|
|
|
 |
Hi i am writing a simple app with doc/viw architecture, now i have to buttons in the Outlook bar "Folders" and "Calendar" now i want that when restart the app the selected pane will be always the 0 -> "Folders" now i tried this:
CMFCOutlookBarTabCtrl* pOutlookBar = (CMFCOutlookBarTabCtrl*)m_wndNavigationBar.GetUnderlyingWindow();
pOutlookBar->SetActiveTab(0);
After this nothing happen. Why this?
i wait for your precious response
Giovanni
|
|
|
|
 |
I want to write a adapter which can convert non static member functions to C-sytle function pointers. Here is what I got now(see the following code snippet), but the current solution is not general. I want to make int (T::*Func)(int) accept variable arguments. but i'm stuck here? anybody can help me?
and it's necessary to make int f() and int display have the same signature.
The final goal is Interfacing C++ member functions with C libraries.
class StoreVals
{
int val;
public:
int display(int k) { cout << k << endl; return 0; }
};
template<class T, int (T::*Func)(int) >
class CObjectT
{
public:
static int f(int i)
{
T obj;
return (obj.*Func)(i);
}
};
void main()
{
CObjectT<StoreVals, &StoreVals::display>::f(7);
auto function_t = &CObjectT<StoreVals, &StoreVals::display>::f;
cout << typeid(function_t).name() << endl; }
|
|
|
|
 |
Falconapollo wrote: The final goal is Interfacing C++ member functions with C libraries.
If you want your C++ code to call C libraries then you use
extern "C" {
...// C code and/or declarations.
}
If you want C libraries to call your C++ code then you must provide a C interface to it.
|
|
|
|
 |
I have a PDF. If I use this
CString Path = GetPath("manual.pdf");
ShellExecute(0, "open", Path, NULL, NULL, SW_SHOWNORMAL);
The PDF executes. But if I then use
Path += "#page=17";
ShellExecute(0, "open", Path, NULL, NULL, SW_SHOWNORMAL);
or anything similar, I cant get the PDF to execute. I want the PDF to
execute and jump to a specific page. I found solutions, I think, where
I can execute the adobe.exe file and the path, but I dont know where
adobe.exe is located on these computers. Is there any way to execute
a PDF without knowing where the adobe executable is at?
Please, any response any one can give me will be greatly appreciated.
|
|
|
|
 |
I suspect you can't open it to a specific page without knowing where Acrobat resides, but no matter - you can find that out from the registry apparently.
If you have a look at the key:
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\App Paths\AcroRd32.exe\ you can get the full-path of the exe.
From there, it's seems to be just a matter of passing that file to shell execute along with using a parameter that includes (1) the full path to the pdf doc and (2) the desired page num.
Anyhoo - here's my source: http://www.devhut.net/2013/12/04/vba-open-a-pdf-to-a-specific-page/[^]
|
|
|
|
 |
The third parameter in the call to ShellExecute [^] can be used to pass the extra parameters to the called application. All you need to do is check Adobe reader for the format of those parameters.
|
|
|
|
 |
Another thing to think about is whether the computers you are targetting have Adobe reader installed at all. Personally, I use SumatraPDF for viewing PDFs, but there is a Microsoft reader app (its name escapes me right now), Foxit Reader, and probably others. Each of them could have different ways to specify the page to show first.
|
|
|
|
 |
What is the net value of Path ?
"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
"You can easily judge the character of a man by how he treats those who can do nothing for him." - James D. Miles
|
|
|
|
 |
Quote: fatal error: Utility1.h: No such file or directory
compilation terminated.
|
|
|
|
 |
The message is telling you what is wrong; what is it about "No such file or directory" that you do not understand?
Given this and your other questions, I strongly recommend you get hold of a decent reference on C programming. You cannot expect to learn it by asking repeated questions here.
|
|
|
|
 |
but it is inside the directory that wat i was asking is it due to logical error or wat?
|
|
|
|
 |
Are you sure that your project configuration includes that directory in its search path?
|
|
|
|
 |
Quote: can anyone suggest how to convert matlab code into c code..for resampling function
|
|
|
|
 |
This question is impossible to answer. Code conversion is mostly a manual task. If you want an automated conversion tool then you should use Google to find suggestions.
|
|
|
|
 |
what is this catalysis MCS tool..
|
|
|
|
 |
maibam debina wrote: what is this catalysis MCS tool. Sorry, I have no idea.
|
|
|
|
 |
actually in matlab the function is available for resample but in c for me its hard so can u suggest some.
|
|
|
|
 |
Sorry, but I do not know matlab, you would probably get better response by going to a dedicateed forum.
|
|
|
|
 |
but i know u r master in c program..so leaving matlab aside do u know how to represent in c code for resampling..
|
|
|
|
 |