|
In fact the user need not specify a file. There is "dummy entry" as a default.
The whole bunch of files can represent different views of a cardiac study, which are all displayed. The trouble is that lately there can be multiple studies in the same directory and those I don't want to display together. I have to make a list and ask the user which one he wants, then I go pick up just the parts of the chosen study.
All this is already working. The only part which bothers me is if he goes back to the same directory to pick another study. If he happens to select the same file, then it is already "open".
(A bit of a lie here. The "dummy entry" doesn't work in the normal open file, as the file doesn't exist.)
I've been looking around and I found another suggestion on how to solve the problem. That suggests to use ID_FILE_NEW up front and inside OnNewDocument distinguish if it is the first time around or not. If not, add my dialog to change the directory. Someone suggested this way back in 1997.
Thanks for your suggestions. I still don't know why they don't work. It may have something to do with the fact that I am in the middle of an ID_FILE_OPEN command.
Ilan
|
|
|
|
|
ID_FILE_OPEN is not a message, it is a command. One could get away with posting a WM_COMMAND message with ID_FILE_OPEN as the menu item.
PostMessage(AfxGetMainWnd(), WM_COMMAND, MAKEWPARAM(0, ID_FILE_OPEN), 0);
You may be right
I may be crazy
-- Billy Joel --
Within you lies the power for good, use it!!!
|
|
|
|
|
I tried to compile a simple Dialog project with just a simple CARRAY declaration of a new class called CPoint3d.
I receive the following error
Generating Code...
Compiling...
MyTestDlg.cpp
c:\temp\mytest\mytestdlg.h(36) : error C2143: syntax error : missing ';' before '<'
c:\temp\mytest\mytestdlg.h(36) : error C2501: 'CArray' : missing storage-class or type specifiers
c:\temp\mytest\mytestdlg.h(36) : error C2059: syntax error : '<'
c:\temp\mytest\mytestdlg.h(36) : error C2238: unexpected token(s) preceding ';'
Generating Code...
Error executing cl.exe.
MyTest.exe - 8 error(s), 0 warning(s)
--------------------------------------------------
Here the declatation. What seems to be wrong here ?
----------------------------------------------------------
class CPoint3D
{
public:
CPoint3D ()
{
x = y = z = 0;
}
CPoint3D (int xPos, int yPos, int zPos)
{
x = xPos;
y = yPos;
z = zPos;
}
int x, y, z;
};
-------------------------------------------------------------------
class CMyTestDlg : public CDialog
{
// Construction
public:
CMyTestDlg(CWnd* pParent = NULL); // standard constructor
----> CArray<cpoint3d, cpoint3d&=""> array; ------------->ERROR
// Dialog Data
//{{AFX_DATA(CMyTestDlg)
enum { IDD = IDD_MYTEST_DIALOG };
// NOTE: the ClassWizard will add data members here
//}}AFX_DATA
// ClassWizard generated virtual function overrides
//{{AFX_VIRTUAL(CMyTestDlg)
protected:
virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
//}}AFX_VIRTUAL
// Implementation
protected:
HICON m_hIcon;
// Generated message map functions
//{{AFX_MSG(CMyTestDlg)
virtual BOOL OnInitDialog();
afx_msg void OnSysCommand(UINT nID, LPARAM lParam);
afx_msg void OnPaint();
afx_msg HCURSOR OnQueryDragIcon();
//}}AFX_MSG
DECLARE_MESSAGE_MAP()
};
-----------------------------------------------------------------------------
sdancer75
|
|
|
|
|
Try adding an
#include <afxtempl.h> to your header file.
-- modified at 7:02 Sunday 14th January, 2007
"Why don't you tie a kerosene-soaked rag around your ankles so the ants won't climb up and eat your candy ass..." - Dale Earnhardt, 1997 ----- "...the staggering layers of obscenity in your statement make it a work of art on so many levels." - Jason Jystad, 10/26/2001
|
|
|
|
|
thanks, that was the solution.
Best Regards,
sdancer75
|
|
|
|
|
Please use the pre tag (above the emoticons) when you post code. And also, whe nyou have < or > characters in the code, replace them by the '<' tag (also just above the emoticons). In your case, the code is unreadable (because it uses templates that are discarded).
One possible solution: did you include the necessary header for the CArray ? Did you also include the header file from your CPoint3D class ?
(please edit your post and correct the formating).
|
|
|
|
|
view source won't work for me, so I can't read your code. Either way, I concur with the person who said that you probably don't have the headers included.
Have you tried std::vector ? It's like CArray, only good. You'll still need to include the header, but you'll be writing standard C++ and you'll find it will do a lot of stuff that CArray won't, if you ever need it to
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
|
|
|
|
|
CArray is a template class. You can't create an instance like this:
CArray array; //wrong
It should be
CArray<myclass, myclass&> array;
where myclass is the type of object the CArray container contains.
Mark
*EDIT* I just realized you probably had it that way but the angle brackets got axed
Never mind!
|
|
|
|
|
Maybe you need to include header file
|
|
|
|
|
Hi,
Iam Leela from India..
I would like to know if there is any tool that helps us to know what all FUNCTION call are made on a particular DLL (Windows or third party) by a particular application..
Thanks a lot..
Regards,
Leela
Thanks a lot for answering my questions..
|
|
|
|
|
Hi Leela,
Take a look at code injection, there are some really good articles on codeproject about it.
http://www.codeproject.com/threads/winspy.asp
http://www.codeproject.com/system/inject2exe.asp
http://www.codeproject.com/useritems/inject2it.asp
/Mark
|
|
|
|
|
Hi Mark,
Thanks a lot for pointing the resource. But i want to know if there is any utility (free or paid) to track dll calls done on my system.
I would like to know if atleast there is any utility to LOG all SQL queires run on a PARTICULAR table in MS SQL..
Thanks a lot..
|
|
|
|
|
If you are looking for something to log all queries from a database check the documentation. Most, if not all, database implementations support a way trace all the SQL commands made to their database. That would be a lot easier then injecting your code and logging them yourself.
Even if you can't restrict it to one table, you can log everything and later use something like grep to get just the lines you are interested in. Hope this helps.
/Mark
|
|
|
|
|
Hi Mark,
Thanks for you suggestion.
I see that we can track activity on SQL server using SQL Profiler..
http://msdn2.microsoft.com/en-us/library/ms979207.aspx
Regards,
Leela
-- modified at 12:59 Monday 15th January, 2007
|
|
|
|
|
ToughGuy9 wrote:
I would like to know if there is any tool that helps us to know what all FUNCTION call are made on a particular DLL (Windows or third party) by a particular application..
HI Leela or ToughGuy9 ( seems some Contradiction)
anyways you can see all the function exported by particular dll via tool name Depends, which is part of regular Visual Studio! and it can be found in tools directory of VisualStudio installation
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
Support CRY- Child Relief and you
|
|
|
|
|
Hi Alok,
Thanks for your post..
I am using depends (Dependancy Walker) to look at list of functions and what functions are called. But what i want is to track the FUNCTION CALLS..
Regd the contradiction with my Name (nick) and display name : My name is LEELA KRISHNA.. My nick is LEELA..
Regards,
|
|
|
|
|
Hi all
I had written a FTP directory listing program.Problem here is its working fine on my FTP server,but its not working working on client ftpserver i.e.,iam unable to get directory listing there....
I used following classes:
class CFileFind;
class CInternetSession;
class CFtpFileFind;
pf = is.GetFtpConnection((LPCTSTR)servername, (LPCTSTR)username, (LPCTSTR) pwd, portno, session_mode);
although i have set session_mode both TRUE and FALSE, it still doesn't work or throw any exception
Thanks,
xyz
|
|
|
|
|
Hi,
I am a newbie in MFC gui programming. Here is one problem that I am facing..
I am setting text in an edit control and then i need to set the cursor at the end of the text. If I use SetEditSel, it highlights the text also. I do not want the highlighting of the text. I just want the cursor to be at the end of the text ,after I have called SetWindowText().
I searched around and found that SetCursorPos can help. But I do not know how to provide the correct text coordinates to this API. any ideas would be greatly appreciated.
Code snippet:
InSomeHandler(){
GetWindowText(str);
// do something
SetWindowText(str);
// set the cursor at the end: don't know how to do it..
}
Be the change you wish to see...
|
|
|
|
|
You can use SetSel for this. I assume you're using a CEdit control. Let's say this control is accessed through a member variable called m_edit and contains the text str , you can then set the cursor to the end of the control by calling this:
m_edit.SetSel(str.GetLength(), 0, FALSE);
|
|
|
|
|
...and probably other VC editions.
I've not the need/use of Intellisense and it bothers me a lot slowing down my projects load/unload time so I searched and found a way to get rid of it.
Simply delete C:\Program Files\Microsoft Visual Studio 8\VC\vcpackages\feacp.dll.
Yarp
http://www.senosoft.com/
|
|
|
|
|
Hello gang,
I have an engine in legacy c as a dll and wanna get its functionality from a UI written in c#. what makes me sick is that as project grows and complexities increased how is it possible to debug c# and its legacy 'c' dll toghether. I again say simply i want to F11 my c# line and go to legacy c functions and vice versa ...
give me a clue please if you know the tips...
http://www.packetforum.org
|
|
|
|
|
I wrote a DLL and want to put it into a XP workstation in my Lan, certainly, i know its administrator account password. but how can i put it into its system folder without setting any share folder manually? if it is possible, then how can i invoke the rundll32 command to load my dll remotely? Thanks for your instruction.
liur
|
|
|
|
|
You can't "run" a DLL. You can load it with an executable, but you can't run it by itself.
"Why don't you tie a kerosene-soaked rag around your ankles so the ants won't climb up and eat your candy ass..." - Dale Earnhardt, 1997 ----- "...the staggering layers of obscenity in your statement make it a work of art on so many levels." - Jason Jystad, 10/26/2001
|
|
|
|
|
Thanks, my mean is how to put the dll into remote XP and loading it by rundll32 command. could you give me any suggestion?
liur
|
|
|
|
|
First you have to get the DLL over to that machine. So it's a simple case of how do you want to get the file over there. You have options: E-mail, on a floppy, windows file sharing, etc.
|
|
|
|