Thanks for a very fine and serious answer. 5 from here. I can't wait to get back to work monday. Cheers
janman
Posts
-
Referenced assembly from dynamically generated assembly. -
Referenced assembly from dynamically generated assembly.Hi, I am using CSharpCodeProvider for the first time (.NET 1.1 & VS2003). My application has been used without problems for a few weeks. Now I started using an external assembly (PortController.NET) from the generated assembly. I can access the generated assembly (create objects and call methods) but when it reaches the poing where it uses PortController.NET (creating new object) I get the exception: File or assembly name PortController.NET, or one of its dependencies, was not found. But it works when executed through the debugger!? My code looks like this:
ICodeCompiler comp = (new CSharpCodeProvider().CreateCompiler()); CompilerParameters cp = new CompilerParameters(); cp.ReferencedAssemblies.Add("system.dll"); cp.ReferencedAssemblies.Add(@"C:\Program Files\PortController.NET\PortController.NET.dll"); cp.GenerateExecutable = false; cp.GenerateInMemory = true; CompilerResults cr = comp.CompileAssemblyFromFile(cp, filepath);
In VS2003 PortController.NET is listed in the .NET list (for adding references) so I guess it's in the GAC. Any suggestions? Thanks, Jan -
Setting selection in ListView controlI can't seem to find any method to programmatically set the list of selected items of a ListView (in Report view). ListView.SelectedItems is a read-only list !? I'm sure it can be done easyly but .... /Jan
-
MDI version of MTPad from WTL7It's easy to create an MDI application with the WTL application wizard but there's a lot of big questions for a beginner about how to make a usefull application out of it. It would be perfect for me if somebody made an MDI version of MTPad and posted it as an article. Just having the code would be a great help (at least for me). That could give a lot of hints about the differences between SDI and MDI. -------------- Janman.
-
Learning about MDI in WTL7I have been using WTL for about a year now and haven't made any MDI apps yet. I have found many good articles here on CP about how to do this and that with WTL but I haven't found anything showing how to make a usefull MDI application (for my needs). What I'm trying to make myself is an MDI text editor (yes the world needs more of those :~ ). MTPad from the WTL7 samples has almost all I need but it's not MDI :(. What would be perfect for me was if somebody had made an MDI version of MTPad. That could give a lot of hints about the differences between SDI and MDI. I even think it would be great for others too if it was posted as an article here on CP (I will post the suggestion on the right message board too). I'm particularly interested in seeing how to handle printing and the find-text-dialogs in an MDI application. Any help appreciated. -------------- Janman.
-
Getting notification on <CR> from Edit controlThanks alot. That did the trick. I don't think it's mentioned in the book (Pezold). Happy now :)
-
Getting notification on <CR> from Edit controlI have made a dialog-based WTL application in VS.NET. I'm trying to make one edit window act as a command prompt. I would therefore like to receive a notification in the parent dialog when the user presses carriage return in the edit control. I have tried to use the example by Kristian Lippert in his article Subclassing controls in ATL dialogs using WTL[^] but with no luck. It seems that the sub-class does not receive the WM_KEYDOWN or WM_CHAR at all (does receive WM_CHAR when typing some text). First I thought that I could just use the IDOK-notification and use the control ID or the control hWnd parameters of the notification. But they are "empty" no matter which control has the focus when CR is pressed. Any help appreciated. Below is my control-template:
#define EN_GOT_RETURN 0x1000 template <class T> class CEditEnterNotificationT : public CWindowImpl<CEditEnterNotificationT<T> , CEdit> { public: BEGIN_MSG_MAP(CEditEnterNotificationT< T >) TRACEMSG("CEditEnterNotification"); MESSAGE_HANDLER(WM_CHAR, OnChar) MESSAGE_HANDLER(WM_KEYDOWN, OnKeyDown) END_MSG_MAP() CEditEnterNotificationT(HWND hWnd = NULL){ } CEditEnterNotificationT< T >& operator=(HWND hWnd) { m_hWnd = hWnd; return *this; } LRESULT OnChar(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled) { //ignore without a beep switch (wParam) { case '\r': //Carriage return ATLTRACE("WM_CHAR - CR\n"); return 0; break; } return DefWindowProc(uMsg, wParam, lParam); }