|
Is there a way to get a detailed .map file
I have a large structure which is exported in the structure
I have some arrays of structures of which I don't think is the length I am expecting due to a storage overlay durning exection
The number of elements in the structure array is defined with a #defined varaible
e.g.
#define num 30
typedef
struct
{
} A;
A b[num];
due to storage overlay durning exection I dont think b is the length I excpect it to be
Thankx
|
|
|
|
|
Hi,
I'm trying to record user operations (i.e. mouse clicks and/or keystrokes) to certain commands such as Open, Save, Play, Render, and so on. For example, I can use std:map<std::string sCommandID, int iVisit> to count up mouse clicks and/or keystrokes because I want to maintain a commands visiting history list (ordered from the most cliked command to the least clicked one) for each current login user to my application. When the user login to the application, the a commands visiting history list will be presented as an easy reach position on the screen. Worthy of mention is that I want to record the user operations occurred only on main GUI, for example buttons on the toobar, status bar, task pane, main menu bar, and etc. Unlike the screen capture programs (for example, Northon Screen Cam), I don't want to capture the mouse movement, and save the on-screen pictures dynamically at a certain frame rate.
What Microsoft development library or API functions shall I use? Could you give me some programming tips concerned?
Thank you.
GoldenLee
|
|
|
|
|
Golden Lee wrote: I want to maintain a commands visiting history list (ordered from the most cliked command to the least clicked one) for each current login user to my application
since it is your application, you can add the values to map at each message handler of the commands.
see here [^] if you want to get the user login info for the application.
|
|
|
|
|
Hello everybody!
I've got a problem that's been bugging me for some time.
There are a certain number of functions that need to be transformed into dll-s. I've read pretty much all the articles about that on codeproject and that's fine, but I'm still not really confident with windows programming.
You see, every function has to be in its own dll and I have to make a dll-plugin manager. The main thing is that the functions can take a different number and type of arguments - (ex. f1(string s, string s2, string s3), f2(string s, double d)...)
The first argument (string s), and the return value are common for all functions. Is it possible, for example, to have only that one argument (thus achieving uniformity), and take the rest through some kind of message boxes in the function itself? Or is there a better way?
Thank you in advance!
|
|
|
|
|
Ivan-bg wrote: ou see, every function has to be in its own dll
One DLL for one function? It seems against the very nature of the DLL , that is a dynamic library of functions.
Ivan-bg wrote: The first argument (string s), and the return value are common for all functions. Is it possible, for example, to have only that one argument (thus achieving uniformity), and take the rest through some kind of message boxes in the function itself? Or is there a better way?
You can always pass just a pointer to a struct.
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
|
|
|
|
|
I wasn't precise enough. I was talking about the main class of functions, that have to be separated. Each dll will contain 4 more functions that are of the same type.
I would pass a pointer to a struct, but the point is that the program is supposed to be extendable - anyone could add another algorithm (main function), which takes a string and a certain number of parameters of different types. That's why I can't make any assumptions about the number and type of parameters, or struct members.
Any ideas?
|
|
|
|
|
Ivan-bg wrote: Any ideas?
Yes, pass an array of VARIANT s.
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
|
|
|
|
|
|
Open Excel file,Error
_ConnectionPtr m_adoConn;
_RecordsetPtr m_adoRec;
::CoInitialize(NULL);
m_adoConn.CreateInstance(__uuidof(Connection));
m_adoConn->Open("Provider=Microsoft.Jet.OLEDB.4.0;Data Source=c:\\1.xls;Extended Properties=Excel 8.0;IMEX=1;","","",adModeUnknown);
stop this function:
inline HRESULT Connection15::Open ( _bstr_t ConnectionString, _bstr_t UserID, _bstr_t Password, long Options ) {
HRESULT _hr = raw_Open(ConnectionString, UserID, Password, Options);
if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this));
return _hr;
}
why error
thank
Blog:
http://taotesea.spaces.live.com
|
|
|
|
|
What error do you get (usually errors are quite informative)? On what line of 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
|
|
|
|
|
|
there are several choices of exceptions handling for c/c++(win32 platform).
but what are the differences among try...catch, __try...__except,and try...finally?
and when we should use the most suitable one of them?
Regards.
modified on Sunday, March 9, 2008 1:28 AM
|
|
|
|
|
|
but they are more complex in my mind,for example
DWORD test()
{ //cout<<"A exception handled."<<endl;
return EXCEPTION_EXECUTE_HANDLER;
}
void main()
{
try//__try
{
__asm int 3;
}
catch//__except(test())
{
cout<<"A exception "<<endl;
}
}
here,the program can't work will ,but if replaced by __try...__except,it works well.why?
|
|
|
|
|
Structured exception handling works with C and C++ source files.
It was not designed for C++ specifically. To ensure your code is portable, you will want to use C++ exception handling.
As stated by MSDN, for "C++ programs, C++ exception handling should be used instead of structured exception handling"
SkyWalker
|
|
|
|
|
thanks.
I will go and read it carefully.
|
|
|
|
|
If this a C program, i think you cannot use C++ exception.
|
|
|
|
|
but if i treat it as a c++ program?
the code can be compiled and linked no matter i use try...catch or __try...__except.
the only difference is the result of running.
|
|
|
|
|
By default, VS2005 uses synchronous exception model by default. Try changing to /EHa (vsproperty->C/C++->Code generation->Enable C++ Exception = /EHa).
And read the msdn document whose link i already given (especially Synchronous & Asynchronous exception handling).
|
|
|
|
|
|
Hi,
I like to draw lines with delay but using threads. The data will be fetched from different list (m_lstpoints). they have to be drawn simultaneously. When i tried to do this i am getting illegal.
I am very much new to threads. Can u help me.
//Code
CRITICAL_SECTION g_csGDILock; //Initialized
AfxBeginThread(DrawStrokesUsingThrd, (LPVOID)pTInfo1);
AfxBeginThread(DrawStrokesUsingThrd, (LPVOID)pTInfo2);
AfxBeginThread(DrawStrokesUsingThrd, (LPVOID)pTInfo3);//This list
is dynamic
//The pTInfo contains the g_csGDILock pointer and other info
//to draw points such as dc and list of points.
void CPlotPoints::TDrawPoints(HDC hdc, PRTL_CRITICAL_SECTION pMutex){//Non static
POSITION pos =NULL;
CPoint pt1, pt2;
pos =m_lstPoints.GetHeadPosition();
pt1=(CPoint) m_lstPoints.GetNext(pos);
while (pos){
EnterCriticalSection(pMutex);
{
pt2=(CPoint) m_lstPoints.GetNext(pos);
CDC dc; //hdc is a CClientDC
dc.Attach(hdc);//I had even tried to Send CClientDC* directly
//Plot code begins
//Here we draw rectangles,lines or something using dc
//dc.Moveto(pt1); //These lines are giving assertion
//Plot code ends here
dc.Detach();
GdiFlush();
}
LeaveCriticalSection(pMutex);
Sleep(300);
}
}
Thank you.
Manu
|
|
|
|
|
|
Several remarks first:
- You don't describe which problem you are having: "i am getting illegal" is not very informative sentence to me
- Use the pre tags to format your code properly because it is almost unreadable.
- Please, read the posting guidelines on top of this forum.
Now for your problem: if you are trying to draw things from multiple threads, that's probably why your code crashes. You should only have the main thread that access the UI.
|
|
|
|
|
Sir,
You got it. I am sorry to say this that i mentioned in the code
with a comment where i am getting illegal or assertion dailog.
("//dc.Moveto(pt1); //These lines are giving assertion").
I am clearly and purposefully making my child threads to
draw the lines. What is the alternative. More over i had initialized
the critical section also.
1. Shall i ask the view to redraw the points by sending the points
2. or else i have to do something else.
Thanks for answering my question.
Regards,
Manu
|
|
|
|
|
kanduripavan wrote: 1. Shall i ask the view to redraw the points by sending the points
Yes, you should find a mechanism that let the view (and only the view) redraw the data? Everything that is 'generated' from the threads should be independant from the view. You'll need to store this data somewhere and inform the view that new data is available by sending a message to the view. Access to the data should also be protected with critical sections (for example).
|
|
|
|