|
If you do,
CObject* ptr = new CObject();
It performs that in two steps:
1. Calls the CObject constructor
2. Then it assigns the instance to the ptr
ptr is uninititalized when the CObject constructor is called. It's not initialized until after the constructor returns.
It might allocate the memory for ptr before it calls the constructor, but it does not contain a useful value. It's uninitialized until the assignment occurs.
The difficult we do right away...
...the impossible takes slightly longer.
|
|
|
|
|
Thanks I think the only other way I Might ? be able to do what I want is use the "this" pointer
Assuming that KeyStroke is a Abstract Object used within the context of Cricheditctrl
The this pointer would be that of the CRicheditctrl
I can set a breakpoint inside the KeyStroke constructer check the "this" value
and check "myrich =" pointer afterwards to see if they are the same value
otherwise I guess I would set the richedit ptr after I allocate the object
thanks
|
|
|
|
|
In the KeyStroke Contructor
I cast a "this" pointer to CRicheditctrl * and I wrote down the address
I then observed Cricheditctrl pointer assigned after the new and it was the same address
i'll cut and paste the code for more clarity
KeyStroke::KeyStroke(int numlines, CRichEditCtrl* editptr)
{
max_line = numlines;
edit_ptr = editptr;
edit_ptr = (CRichEditCtrl*)this;
}
myedit = new CProgedit((int)30,myedit);
|
|
|
|
|
A common solution to add such functionality is adding a KeyStroke member to your Rich Edit derived class and pass the this pointer to the member:
class MyRich public CRichEditCtrl
{
public:
MyRichyRich(int numlines);
KeyStroke m_KeyStroke;
};
MyRich::MyRich(int numlines) :
m_KeyStroke(numlines, this)
{
} But this will generate a C4355 warning. To avoid that, you can make the KeyStroke member a pointer and allocate it in the constructor:
MyRich::MyRich(int numlines)
{
m_pKeyStroke = new KeyStroke(numlines, this);
} or provide an initialisation function:
MyRich::MyRich(int numlines)
{
m_KeyStroke.Init(numlines, this);
}
Your problem is not the error message from the subject but that you want to access your Rich Edit object before it is created (and did not use this instead).
|
|
|
|
|
Thanks upon entry to the constructer the "this" pointer is valid
Thanks
|
|
|
|
|
I created an xll excel add-in with Visual C++ 2013 and Excel 2007/2010/2013 XLL SDK package. In the application I have to load a third party dll which depends on MSVCR90.dll for release version and MSVCR90D.dll for debug version. But I don't know how to load the MSVCR90D.dll in the project. What I tried is to create an additional manifest file or use a pragma comment instead in the code like
#pragma comment(linker, "/manifestdependency:\"name='Microsoft.VC90.DebugCRT' processorArchitecture='x86' version='9.0.30729.1' type='win32' publicKeyToken='1fc8b3b9a1e18e3b' \"")
It works in win32 console application but not in xll application.
Also I wonder why in the xll application all the release version of msvcr dll including MSVCR90.dll, MSVCR100.dll and MSVCR120.dll are automatically loaded if they are installed in windows system. Since I am working in vc++ 2013, msvcr120d.dll is loaded as well.
Can anyone tell me how msvcr90d.dll can be loaded as well?
visual c++ 2008/2010/2013 redistributable packages are installed.
|
|
|
|
|
There is no need to load these DLLs in your project. They must be only present on your system so that they can be found and loaded by the 3rd party DLL when your application is executed. The only problem might be getting the debug version (MSVCR90D) because it is not publicly available (not allowed to be distributed).
If you have it, just copy it to your project's Debug folder where it can be found when executing the debug executable.
There might be also problems when using different runtime library versions from a single application, but I have no experiences with that. The best solution would be to ask the supplier of the 3rd party DLL if he can provide a version build with VS 2013 or a version that has the runtime statically linked.
|
|
|
|
|
When I copied the DLLs in the project debug folder, the problem still exists.
When I copied the DLLs in the folder where the 3rd party DLL is, I got a R6034 Debug error "An application has made an attempt to load the C runtime library without using manifest".
|
|
|
|
|
Dropping the exact error text into google didn't help you like it helped me?
The very first result was the following: C Run-Time Error R6034
|
|
|
|
|
I need some hint how to identify / troubleshoot this syntax error.
/home/vaclav/TEMPLATE_Cross_GCC_RPI: 1: /home/vaclav/TEMPLATE_Cross_GCC_RPI: Syntax error: "(" unexpected
I get it when I specify
"/home/vaclav/TEMPLATE_Cross_GCC_RPI"
as "file path". The path is valid.
Mrs Google suggested "linux bash error".
I am lost.
Amy help would be greatly appreciated.
Cheers.
Vaclav
|
|
|
|
|
Missing shebang line?
#!/bin/bash
In vino veritas
|
|
|
|
|
Nope, now It get invalid file.
I get this error after I let Eclipse identify the file path by reading the remote (ARM) system.
I think the combo box is looking for partial path.
I do not have any means to really know what suppose be entered into the field.
Let me find other IDE and put this on hold for now.
|
|
|
|
|
Without seeing your code it's anyone's guess. Is this really a C/C++ issue?
|
|
|
|
|
You do not need my code, but I am willing to add to the OP whatever you need could help.
It is simple "text" box where "(Remote ) file path " is entered.
Such as "/this/that ".
If I enter invalid path I get different error, so I know the path is valid.
I really need to get the source code for this dialog to find out why simple text like that causes the funky error.
Let me work on that.
|
|
|
|
|
Vaclav_Sal wrote:
You do not need my code, but I am willing to add to the OP whatever you need could help.
It is simple "text" box where "(Remote ) file path " is entered.
Such as "/this/that ".
If I enter invalid path I get different error, so I know the path is valid.
I really need to get the source code for this dialog to find out why simple text like that causes the funky error.
Let me work on that.
Well, we still cannot guess what you are talking about, a C/C++ program, a bash script ... and exactly where does this error message occur?
|
|
|
|
|
Vaclav_Sal wrote: /home/vaclav/TEMPLATE_Cross_GCC_RPI: 1: /home/vaclav/TEMPLATE_Cross_GCC_RPI: Syntax error: "(" unexpected
I get it when I specify
"/home/vaclav/TEMPLATE_Cross_GCC_RPI"
My guess is that you are guessing. You are making one or more assumptions that are incorrect. Some examples.
1. The path that you think you are using (in dialog) is not the one that you are actually putting there.
2. Your code is doing something with the path, from the dialog, and it is that path, not the one in the dialog, that has the problem.
Solution.
1. Find the EXACT line where the error occurs.
2. BEFORE that line log/print the EXACT path that is being used. PUT delimiters around the value so you know exactly where it starts. Such as (pseudo) print '{' + val + '}'.
Take care with 2 that you do not make assumptions. For example if you pass to parameters to the failing line the log/print both of them, do not concatenate.
|
|
|
|
|
jschell wrote: My guess is that you are guessing. My guess is that you are exactly right.
|
|
|
|
|
No more stupid , what else can I call it?, replies please.
If you read the OP it is the VALID ENTRY to the options text box.
Nothing to do with my code.
If I knew WHERE TCF implements these options I would resolve this myself.Perhaps in my spare time I'll search git for it.
I fail to see how I can describe the problem any differently.
Let's just drop it.
I am using different "Configuration", not TCF, to access the target and it works using SAME, EXACT option TEXT to specify the "remote" file path.
Problem solved (?)
Thanks
|
|
|
|
|
Vaclav_Sal wrote: If I knew WHERE TCF implements these options And if you had mentioned TCF (whatever that is) in the first place you would most likely not have got what you call "stupid replies". Like so many questioners here, you provide only half the information and then blame us when you don't get the correct answer in return.
|
|
|
|
|
As guess, from googling, "TCF" is an open source library that one can use. Because it is open source it can be modified.
Otherwise, for this and other third party libraries, first and best source are the support forums for the library. Might also look through the bug reports for the library since it might be something that is already known.
|
|
|
|
|
Call me dense - but I see this as OS error / verification error and I did my best to find what parameters are expected in the control. At one point Eclipse did confirm the "file" selected.
Unfortunately this TCF is pretty much dead as far as any support from the original vendor.
Please consider this matter closed.
|
|
|
|
|
Hi,
I am developing a service which will install on system level (not on user level). I need the name of current user logged in.
Please suggest to get it.
|
|
|
|
|
|
As a long time user of this forum I must first apologize for OT post.
I am getting desperate to be able to use TCF in Eclipse IDE.
I have been unable to find out HOW to use "TCF Configuration" dialog. I have been posting on Eclipse forums and getting nowhere. This plug in apparently is obsolete / unsupported by anybody technology. There are "power point" tutorials which do not address the actual usage / configuration of the tool.
I am simply looking for somebody who "been there / done that". I do not need code help.
Thanks
|
|
|
|
|