Hi, I'm creating a Crystal Reports report from an XML-file. This file holds some paths to images that I want displayed in the report. However, I can't get an image to get its location from a Crystal Reports field. Is there a way to do this, and so, how!? I'm using the Visual Studio .NET version of Crystal. Otherwise I think its a real potention tool, its just this image-thing... Structured programming vs. chaotic mind boggling
D D de Kerf
Posts
-
Dynamic Image in Crystal Reports -
Moving GUI from EXE to COM-dllHi, I have constructed a generic application with the idea to use it over and over again. The problem is that this application also has a user interface that is different for different customers. The functionality is roughly the same, though. Now I'm trying to do the following. The GUI was implemented in document/view/frame combinations which run in an MDI application. These forms were originally programmed inside the exe but now I want to disconnect them from the exe one way or the other. My idea was to put them in a COM-component and let the component register the document/view/frames in the exe. This doesn't work though. As soon as I try to create a childframe window in the COM-component, I get messages that the main window isn't valid (HWND obviously is corrupted, which I can understand).... Is there a way to get this job done? I've been considering the following alternatives: * Move the GUI-classes to a MFC Extention DLL and somehow extract them from there and let the exe create the dialogs/views * Put the GUI-classes inside a toolwindow docked inside the MDI-app. I still have problems with the parent-window pointer them, though * Something else... Maybe use full-screen modal or modeless dialogs and create those inside a COM component.... I still prefer my first idea though, if it is technically realisable.... Can anyone help? Structured programming vs. chaotic mind boggling
-
Show HTML in Windows ApplicationWell, I didn't ever know that I could use this write-function. It is also the first time I've ever got it working. Here are the steps: 1) Add Explorer to your toolbox (customize toolbox -> COM components -> Microsoft Web Browser) and add it to your form 2) Add a reference in your C# project to Microsoft.mshtml 3) use mshtml in your .cs-file like this:
using mshtml;
4) Browse to about:blank like this (ieBrowser is the browser-component):object o = new object(); ieBrowser.Navigate("about:blank", ref o, ref o, ref o, ref o);
5) Fill the HTML from a string like this:IHTMLDocument2 doc; object oDoc = ieBrowser.Document; doc = (IHTMLDocument2)oDoc; doc.write("This is **bold** and this is _italic_");
That should do the trick. Thanks for the tips!!! Structured programming vs. chaotic mind boggling -
Show HTML in Windows ApplicationHi, I have some postings in a database and these postings are all noted in HTML-form because my initial idea was to show them from a web-application. Now I also want to show them through a windows application, the question is: how? So I want to render HTML and show it in a .NET Windows Application. But I can't find a control to show the HTML. I know there is a control to show Richt Text Format, but that's still no HTML. I also know you can use the Internet Explorer ActiveX component, but I don't really want to, because that component can only show HTML from physical files and URL's, not directly from a String.... Does anybody know about the existence of a .NET-component that can show HTML directly from a string or do I really have to use the IE-component??? Structured programming vs. chaotic mind boggling
-
DataGrid.DataBind effect doesn't last!Hi, I wrote a subclass of DataGrid in which I can fill the grid the way I want it to happen on each page. In this grid I also create some dynamic comboboxes and bind a SelectedItemChanged event to it. When this event fires, I want to put different data in the grid. Now, I've implemented this event by creating a new dataset and dataview and binding that to the Grid. If I step through the code, you can see the right effect. After the DataBind, the numer of items in the grid is exactly the way it should be.. So far, everything is as you would expect. But if I put a breakpoint in the PreRender event and look at the items in the grid, nothing has changed! The content of grid is exactly the way it was BEFORE my BindGrid.... When does this happen, who is doing this, and how do I shut it off? :confused: Structured programming vs. chaotic mind boggling
-
DataGrid subclass with auto-filter functionalityI'm trying to construct a subclass of the ASP.NET DataGrid with automatical filter functionality. The idea is as follows: The page that uses the DataGrid uses the SetQuery function to tell the grid what It's main query is. This happens in the Page_Load and it splits the query in 2 to seperatie the SELECT ... WHERE clause and the ORDER BY clause... The Grid subclass adds an empty row at the top of the row and puts dynamically created comboboxes in them with all unique values from that column that come from the query. When the user selects an item form one of those comboboxes, the grid refreshes itsself by binding the old query with some self-constructed restrictions... The PROBLEM is that I can't find the right place to do this 'requery'. If I put my code in the OnLoad function it's to early, because the selected value of the combobox isn't known yet. And if I put my code in the selectedIndexChanged event handler of the dynamically created combobox, it's to late to bind the grid, because when I do a DataBind with the new dataset (the dataset is OK!), the old data is still shown on the screen... I've been trying to fix this for about 2 days now, but can't get it to work. It is really important to me that this works, because if it doesn't, I'm going to have to place filters on every page manually instead of using this generic solution. Structured programming vs. chaotic mind boggling
-
Hatched Brushes + a Scrolling View = Wacky LinesHi, I've written a document-view-application which draws boxes with fillings. I draw the fillings using a CRect and filling that with a hatched brush (HS_BDIAGONAL, HS_CROSS and so forth).... All works well until I start scrolling. It looks as if the view just draws the part of the document in the view that was invisible, but became visible because of the scroll... It also looks as though the brush's origin just takes the first visible point to start drawing instead of really using the coordinates of the rect it fills (because the top part of the box was, at the time, outside the viewport)... This results into wacky lines like this picture: http://hioforum.ftn.hsbrabant.nl/data/wacky\_lines.jpg Any idea of how to fix this? I don't like rewriting to code to manually drawing the lines, but of course it is an option.... Structured programming vs. chaotic mind boggling
-
Showing window with and without title barHi, I recently discovered the CTabCtrlSSL demo on this site (http://www.codeproject.com/tabctrl/ctabctrlssl.asp) and this was exactly what I needed for my problem... but still not completely. In my program I had the situation in which I have one dialog showing up on 2 places: once as a stand alone modal dialog and once within a tab control as a sheet of the tab control. In situation 1 I need to show the title bar, in the second case I need to hide it. (I created the dialog in the resource as a title-bar-less dialog) The problem is that I don't know how to do this in an easy way. I figured out it's got something to do with the CreateEx function, but how do I fit all this inside the dlg-framework?? Thanx, Dave Structured programming vs. chaotic mind boggling
-
Linking error when using template class from MFC Extension DLLActually I wanted what you first described... But reflecting on it, I only want to use the aggregate for subtypes of the myClass_Object class, so that may bring me to your second case... Is it so, that when I explicitly instatiate a supertype, that it will also work for all subtypes of that supertype?? In that case I am probably able to solve it the elegant way, anyway! Thanx a lot! Structured programming vs. chaotic mind boggling
-
Linking error when using template class from MFC Extension DLL>1) When you post code, replace > and < with > and <. The template arguments are >lost without that - I had to view the HTML source to find out that you're using >AFX_EXT_CLASS in template argument declaration. This isn't necessary. Whoops. Sorry. Never thought of that. Pretty stupid of me. >2) Template itself doesn't produce any code, so there's no need to export it. All >information is in .h file, as you have already mentioned. Right. >3) Your template derives from non-template myClass_object. This class must be exported. It was already exported, but it didn't seem to help. My theory about the whole messy situation is that template-classes can't be exported. I read somewhere else over at CodeGuru.com that the template construction is a compile-time trick and since the extension dll has already been compiled, it probably can't use any template classes. I've solved the problem by repeating the code of the template class inside the .h-file that I distribute together with the .lib en .dll file. That way it is compiled both in the extension DLL and in the application that uses the dll. Not an ideal solution, but it works for now. If anyone has valuable input about this situation, I'd love to hear it! Thanks for all your help so far. Dave Structured programming vs. chaotic mind boggling
-
Linking error when using template class from MFC Extension DLLWait, I'm a little off here, I guess.... I would like to use the template class outside the DLL (i.e. export the template class). But when I remove the AFX_EXT_CLASS from the class definition of myClass_Aggregate, the class won't be exported at all, right? So then I won't be able to use it outside the DLL, right??? Or perhaps I don't understand this very well... Structured programming vs. chaotic mind boggling
-
Linking error when using template class from MFC Extension DLLI tried it this way as well: template class AFX_EXT_CLASS myClass_Aggregate : public myClass_Object { public: myClass_Aggregate() { ... } ... } but it doesn't make a difference. It just keeps on saying that it can't link to the specific templated instance... For example, when I do this: myClass_Aggregate bla; it says it can't find the implementation of myClass_Aggregate::~myClass_Aggregate(void) The weird thing is that it apparantly CAN find the implementation of the CONSTRUCTOR... I've been looking around a little, but am quite pessimistic about a good outcome for this problem.... Please help me before I get depressed ;) Structured programming vs. chaotic mind boggling
-
Linking error when using template class from MFC Extension DLLI've implemented all the functions inside the class and it all worked when it was still outside the MFC Extension DLL... There is one thing though, but I don't think it could cause this error: the implementation is done in the .h-file. I would like to try to move the implementation to the .cpp-file, but I never got that working on a template class... :(( Structured programming vs. chaotic mind boggling
-
Linking error when using template class from MFC Extension DLLHi, I'm exporting a template class from my MFC extension DLL, but as soon as I start using the template class outside the DLL, I get linker errors. The template class in the DLL looks like this (myClass_Object is also defined inside the DLL): template class AFX_EXT_CLASS myClass_Aggregate : public myClass_Object { public: myClass_Aggregate() { .... } ... } I use the aggregate with a class from inside the DLL as the template class and the linker error looks like this (myClass_TreeFileNode is a subclass of myClass_Object): DumpDB.obj : error LNK2001: unresolved external symbol "public: int __thiscall myClass_Aggregate::IsEmpty(void)const " (?IsEmpty@?$myClass_Aggregate@VmyClass_TreeFileNode@@@@QBEHXZ) Am I not exporting the class correctly?? Dave Structured programming vs. chaotic mind boggling
-
Resource problem in an MFC extention DLLHi, I'm having a rather weird problem here and I thought that maybe, if I described it, it would ring some bells with the experts. I haven't a clue! Anyway, here's the situation: We have an in-house developed database-access layer with all kinds of specific goodies in it and for reasons of deployment and ease of upgrade, we isolated it in an MFC extention DLL. This all worked fine for a couple of months. I can integrate it easily in existing programs and everything works fine... that is, as long as I integrate it in an exe! The database-access layer in the DLL has a feature which displays a tray-icon. You can see what the layer is doing by looking at the tray-icon's color or by calling a dialog, hidden in the tray-icon's context menu. Of course the dialog and tray-icons are all located in the resource of the extention dll... As long as I integrate the extention dll in a stand-alone application (.exe), everything works fine, tray-icon included. But when I integrate the dll in an activeX-component (complete with clsid and interface) the tray-icon's icon cannot be loaded from the resource! In release build this results in a tray-icon without an icon (just an empty space) which isn't THAT bad, but when I try to bring up the dialog it fails completely (which you might expect). In debug build I get all sorts of assert-failures saying that the icon HANDLE is invalid... So how come everything works fine in a stand-alone application and it fails in an ActiveX component? :confused: Structured programming vs. chaotic mind boggling
-
friend class ain't my friendHmmm, I tried to make a sample project which didn't work (in the way I described), but I couldn't do it, because it just works... Ridiculously enough I then tried to restore my own code in the original project, so that it would produce the error again, but now it just works! I'm absolutely sure I'm doing everything in the same way I did it before, but I just can't get it to not-work anymore... :confused: X| I must have seem a weird anomaly here, but thankt for the remarks! I was making wrong assumptions there, which was wrong. I'm glad it works now the way it should! Structured programming vs. chaotic mind boggling
-
friend class ain't my friendaparently it doesn't, because the example works with you... here's a stripped out version of the REAL class that wanted te have a friend.. class Class_Profile : public Class_Object { // PUTTING THE FRIEND DECLARATION HERE IT DIDN'T WORK public: Class_Profile(Class_Main * pMain); ~Class_Profile(); /* interface */ public: // lots of functions here /* end of interface */ /* methods */ protected: // lots of methods private: // more methods /* attributes */ protected: // a couple of members // PUTTING THE FRIEND DECLARATION HERE IT WORKED private: // lots of members, one of which the one I wanted to acces: Class_Aggregation m_Display; }; Structured programming vs. chaotic mind boggling
-
friend class ain't my friendOK, I've found the cause of this problem. Apparantly the friend-class definition is valid JUST for the section in front of which you define it! So this definition: class SomeOldClass() { friend class dlg_ShowPrivates; public: private: CList m_list; } defines dlg_ShowPrivates as a friend of the next section in the definition which is a PUBLIC section (which makes it a pretty stupid line of code). For the desired effect you should define it as follows: class SomeOldClass() { public: friend class dlg_ShowPrivates; private: CList m_list; } Structured programming vs. chaotic mind boggling
-
friend class ain't my friendHi, I've tried to define a friend class for the first time in my life, but it didn't work out the way I wanted it to... There's a class of some sort and I defined another class (a dialog) as friend of that class, let's say: class SomeOldClass() { friend class dlg_ShowPrivates; public: private: CList m_list; } class dlg_ShowPrivates() { void SetClass(SomeOldClass * pClass) {m_pClass = pClass}; void DoSomethingWithList() { m_pClass->m_list.blablabla; // Do something with the class } protected: SomeOldClass * m_pClass; } The only error I get is on the line where I try to access m_list from m_pClass. I get the old; cannot access private member declared in class SomeOldClass But how come? The dialog is a friend, so should be able to access the privates of SomeOldClass, right? :confused: :confused: Structured programming vs. chaotic mind boggling
-
DHTML removeChild doesn't do as it's toldHi, I'm writing a function that moves the selected options from one listbox to another. To do this, I first find the selected OPTION-elements, remove them from the SELECT-element (not from the document!) and then insert them in the other SELECT-element... But the removeChild function doesn't want to remove the selected item. // Get the selected option-tag (pFromNode is a SELECT-element, pOption is the n-th OPTION-element) pOption = pFromNode.childNodes.item(i); // pOption points to the right option. I know this, 'cause I've inspected the text of the element // This next line, though, doesn't remove the n-th OPTION-element, but ALWAYS the last one. pMoveOption = pFromNode.removeChild(pOption); Any solutions??? Structured programming vs. chaotic mind boggling