|
I will update a field (Say fieldName)in the application. A trigger is executed outside the application in oracle, which changes the value of another field (Say fieldNumber=1, Now changed to fieldNumber=2 after trigger).
The method i follow after field update is :
1. Update (fieldName) to database
2. Refresh the updated value and trigger changed value (fieldNumber=2) to text box. I am doing refresh using select statement .. where ...
(select * from tbl where fieldNumber=1)
Since the trigger changes value outside application, my select statement's where clause have old value (fieldNumber=1). It fails.
Hence i want to know the primary key of the table and use refresh using select statement (only primary key)..
|
|
|
|
|
|
I have a class derived from CRecordset. Please note:
Code "A":
<br />
CString CMyClass::GetDefaultConnect()<br />
{<br />
return L"Connection String";<br />
}<br />
Code "B":
<br />
CStringW strConnectionString=L"Connection String";<br />
<br />
CString CMyClass::GetDefaultConnect()<br />
{<br />
return strConnectionString;<br />
}<br />
My problem is that code "A" works fine, but when I use code "B", I encounter the following error code when closing my app:
"The instruction at "0x00efefa" referenced memory at "0x00ef004". The memory could not be "read". Click on OK to terminate the program."
Please help me...
|
|
|
|
|
Out of curiosity, Why not used _T macro, instead of L literals. And CString instead of CStringW .
Code "A":
CString CMyClass::GetDefaultConnect()
{
return CString(_T("Connection String"));
}
Code "B":
CString strConnectionString= CString((_T("Connection String")));
CString CMyClass::GetDefaultConnect()
{
return strConnectionString;
}
This could not be related to actual porblem, but this is my suggestion.
|
|
|
|
|
See here[^]
Furthermore, you shouldn't use CStringW directly, your code won't compile if you remove UNICODE.
|
|
|
|
|
Thanks for your reply!
I did your advice, but the problem is permanent yet...
I don't know what I can do...
|
|
|
|
|
Usef Marzbani wrote: I did your advice
So, what information did you gather from the debugger ? You have to understand that nobody can help if you don't provide valuable information, and one way to get this info is by using your debugger.
|
|
|
|
|
Usef Marzbani wrote: I don't know what I can do...
for instance
CString strConnectionString = _T("Connection String");
CString CMyClass::GetDefaultConnect()
{
return strConnectionString;
}
and make sure strConnectionString cannot go out of scope.
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
|
|
|
|
|
Actually I see strange code...
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
|
|
|
|
|
You could give me a better solution...
|
|
|
|
|
Usef Marzbani wrote: CStringW strConnectionString=L"Connection String";
What happens if you use:
CString strConnectionString = L"Connection String";
"Love people and use things, not love things and use people." - Unknown
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
Thank you 4 reply!
I found something stranger!
I included "MaxBufferSize" in my connection string and every thing turned well.
Why, Lord!
|
|
|
|
|
Hi,
I need to split the main background of my MDI application (ALSO REMAIN SPLITTED EVEN WHEN NO DOCUMENT IS BEING OPEN). I want to add a ShortcutBar in one of the splitted windows, and MDI documents appear on the other side, when they are created.
Thanks
|
|
|
|
|
hi,
Use CSplitterWnd class.
Construct member varible of CSplitterWnd in your MDI parent class and use CSplitterWnd::CreateStatic to split the MDI into panes then use CSplitterWnd::CreateView to create the Views.
class CMyMDI : public CMDIFrameWnd
{
CSplitterWnd hWndSplitter;
public:
int OnCreate(LPCREATESTRUCT lpstruct);
};
int OnCreate(LPCREATESTRUCT lpstruct)
{
.............
hWndSplitter.CreateStatic(...);
hWndSplitter.CreateView(...);
.......
retutn 0;
}
thanks
Nitheesh
|
|
|
|
|
I'm not going to answer U at all!
I just want to know a little about U...
Where R U from? How advanced R U in programming? and so on...
Maybe we can make a good pair together...
Mailto:info@parasum.com
|
|
|
|
|
I am from India. Having 3.5 years of Experience in MS Technologies
|
|
|
|
|
If you're using MFC, I have a complete sample project I put together when someone asked
this before. It uses the technique described by Nitheesh.
If you want it, I'll send it to you.
Mark
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
I dont know he, but I would like to take a view to this sample project if it is possible
Greetings.
--------
M.D.V.
If something has a solution... Why do we have to worry about?. If it has no solution... For what reason do we have to worry about?
Help me to understand what I'm saying, and I'll explain it better to you
“The First Rule of Program Optimization: Don't do it. The Second Rule of Program Optimization (for experts only!): Don't do it yet.” - Michael A. Jackson
|
|
|
|
|
The sample project zipped can be found here[^]
If you're using VS 2008 and you get the MFC Feature Pack, you can do an app
like this with the wizard and it can have tabbed MDI windows and full docking panes.
Mark
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
Thanks Mark,
at the moment I am not using any version (about 5 months without programming). I want to start another time at home, I'll forget everything if I don't continue in touch with VC++ (I know it was not so much but better than nothing )
Greetings.
--------
M.D.V.
If something has a solution... Why do we have to worry about?. If it has no solution... For what reason do we have to worry about?
Help me to understand what I'm saying, and I'll explain it better to you
“The First Rule of Program Optimization: Don't do it. The Second Rule of Program Optimization (for experts only!): Don't do it yet.” - Michael A. Jackson
|
|
|
|
|
Friends, My code works fine in the debug build but gives
"A structured exception has occurred: Access violation" ... Pls advice... what can be the reason
int ID= GetActiveWindow()->GetWindowContextHelpId(); // can i suspect this statement,
|
|
|
|
|
|
it happnes only in the release build, good in the debug build
|
|
|
|
|
|
See also here [^].
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
|
|
|
|