|
Application crashes at RichEditCtrl.StremOut(), It says attempt to read write protected memory. this often an indication that the other memory is corrupt.
May I know some path to find the issue and fix the issue. Any idea ?
|
|
|
|
|
Check the parameters in your code including your streamout callback routine. You could post a copy here for others to review.
Just say 'NO' to evaluated arguments for diadic functions! Ash
|
|
|
|
|
Sorry here it is :
.....
if (0 != file.Open(m_str, CFile::modeCreate | CFile::modeWrite, &e))
{
EDITSTREAM es = {0};
es.pfnCallback = COleElement::CallFunction;
es.dwError = 0;
es.dwCookie = (DWORD)&file;
lRet = m_cRichEdCt.StreamOut(SF_RTF, es);
}
..........
DWORD CALLBACK CMyClass::CallFunction(DWORD dwCookie, LPBYTE lpBuf,LONG nCount, LONG* Write)
{
CFile* pFile = (CFile*)dwCookie;
if (pFile)
{
pFile->Write(lpBuf, nCount);
}
*Write = nCount;
return 0;
}
|
|
|
|
|
I can see nothing wrong with your code, in fact it is almost a copy of the sample on MSDN. My only suggestion would be to run it through the debugger and see if you can find which value is not valid when the failure occurs.
Just say 'NO' to evaluated arguments for diadic functions! Ash
|
|
|
|
|
|
Hi, Im including one thirdparty reference to my coding.But when i use it my coding it shows error.
My code: In TagInfo.h
ref class Globals
{
public:
static DUAL_INOUTLib::DualInOut^ objVM;
};
Im using it in my coding as In TagInfo.cpp
void CTagController :: ReceiveLivePoints()
{
float PV,SV,MV,P,I,D;
CString name = GetTagName();
System::String^ TgName = gcnew String( name);
double ds;
Globals::objVM = gcnew DUAL_INOUTLib::DualInOut;
Globals::objVM->Open_InOut("ShareMemory", "FRACT", p);
Globals::objVM->Get_real(p, TgName, _T("PV"), ds);
PV = float(ds);
}
But it shows error in line Globals::objVM = gcnew DUAL_INOUTLib::DualInOut as
An unhandled exception of type 'System.Runtime.InteropServices.COMException' occurred in FOPStation.exe Additional information: Retrieving the COM class factory for component with CLSID {52762B50-F702-11D2-9EB1-00C04F888C49} failed due to the following error: 8001010d.
TagInfo.cpp contains more class like, CTagbase,CTagController,CTagIndicator etc.,...I want to use this DualInOut in every class to get values
Anu
|
|
|
|
|
Are you sure you are adding a reference to the managed DLL? It seems to me you may be adding an RCW reference to a COM library?
|
|
|
|
|
Actaully im adding DualInOut.exe(this is wha i want to add).Im addind this to my project through
Add->Reference->Browse and choose the path of exe in programFiles.Thats it.
Then im using it in my code.
It works fine when im using it same clas..For Example,if i defined that class in mainframe.h and if im using that class in MainFrame OnCreate() then it works fine.
But when im using it in different class.Then its not coming??..
Anu
|
|
|
|
|
Is DualInOut.exe a .NET executable or is it a COM server?
|
|
|
|
|
When i see the comment of that exe,it tells that InOut Dual Interface Outprocess COM Sever
Anu
|
|
|
|
|
When i use this whole coding in Mainframe OnTimer() it works fine.
But i have to get lot of live values..So i have to put this in Thread.
So when i do that,it shows error of
An unhandled exception of type 'System.Runtime.InteropServices.COMException' occurred in FOPStation.exe
Additional information: Retrieving the COM class factory for component with CLSID {52762B50-F702-11D2-9EB1-00C04F888C49} failed due to the following error: 8001010d.
Anu
|
|
|
|
|
void main()
{
float a=0.7;
if(a<0.7)
printf("A");
else
printf("B");
getch();
}
If i m putting 0.7 and 0.9 in the question answer is coming "A".else for every option as 0.3,0.5,0.6,0.8 it is coming "B".Why is it so??/...I know the float and double concept...dont tell that...but why is difference in answers ..please focus on that.
|
|
|
|
|
mstanwar wrote: I know the float and double concept
do you really?
0.7 is a real number; it cannot be represented exactly as it is not equal to an integer times some power of 2.
therefore, it has an inherent inaccuracy.
furthermore, it is a double (real constants are double by default in C-like languages); assigning it to a float enlarges the inaccuracy, as there are fewer mantissa bits in a float than there are in a double.
a<0.7 is an expression that gets evaluated as doubles (see the language specification); so you are basically comparing the float representation and the double representation of the number 0.7, and those are both approximations, and unequal, and either one may be the larger one.
If you really knew about floats and doubles, you wouldn't carelessly mix them like that.
|
|
|
|
|
Hi,
I dont know whether this is the right forum to ask this question.
If any 1 can help me about telling what is the basic idea of an intellisense type listbox which doesnt loose focus when we type in the editor. I will use this listbox inside regular MS notepad. I have created hooking application which will show dialog at the caret position but the notepad is loosing focus when the list is appearing.
Thanks in advance.
Regards,
John.
|
|
|
|
|
Do you want a .NET answer? If you want an answer from a native code perspective, you may want to post this in the C++ forum (this is the C++/CLI forum).
|
|
|
|
|
Well i looked a solution to call function from a process that is complitly different from another process so i readed about Interprocess Communication. Now i have only seen some data moving data copying and some text show up tutorials but there is nothing about how to call a function from another process can anyone point me somewhere...?
|
|
|
|
|
Are you sure you want a .NET answer? If you want an answer from a native code perspective, you should post this in the C++ forum (this is the C++/CLI forum).
|
|
|
|
|
hi, i am looking for Open Source QRCode Library, do you where i can find one?
i managed to find an article here but it is for C#, but i am looking for C++ .Net or MFC Library, tried google but still no luck,.
if you know an article here in code project then better, love this forum.. or am i in the wrong forum site the ask this question?
thanks ahead,
|
|
|
|
|
If you are open to using C++/CLI it should be fairly easy to wrap the C# library for use from native code. A C++/CLI version of the library will not offer you any additional advantages over the C# version.
|
|
|
|
|
i reviewed the article posted by twit88, and i would say the syntax looks like C++, well except for the minor difference, i think i can manage to wrap it to C++ to fit my needs,.
but still if you could post something C++ for me to read on it would be better,. but right now i gues i have t stick with C# for awhile to learn the flow of the code..
thanks Nish,
|
|
|
|
|
did you fnd a c++ sample already?...we have the same problem..
i can't search for a c++ qrcode encode sample..even a dll..if you found
one please share it...thanks
|
|
|
|
|
Hi Folks,
I am planning to show a dialog (which will act as a drop down list) on any text editor where the user presses a key combination. I would like to know how I can make the dialog work as if it is part of the application on which it is invoked.
I need to achieve the following things.
1. I want to close dialog when the main application shuts down.
2. I don’t want to take the focus away from the editor when the dialog is active.
3. I want to get the focus on the dialog only when user presses arrow buttons.
4. I want to insert the text selected from the dialog onto the editor
The dialog will help the user to auto complete words. I have done the hooking part.
Please advice.
Thanks in advance,
John.
|
|
|
|
|
Unless you specifically want a managed solution, and you are also working in C++/CLI, you may have better luck posting this in the Native C++ forum.
|
|
|
|
|
C++ CLI .NET 3.5 with VS 2008
When I click into a datagrid cell, I have it coded so that the background changes to yellow.
However when I double click to change the cell content, I loose the yellow effect.
How can I retain it?
Ger
|
|
|
|
|