Thanks! That did the trick. Cheers, Clint
clintsinger
Posts
-
object[] initialization as a parameter -
object[] initialization as a parameterHi, I have a data source that has the the following method. .Rows.Add(object[] obj} How do I pass directly to it an array of parameters within parenthesis? Like the following ...Rows.Add(1, "Hello", "World", 18); or ...Rows.Add("1", "Hello", "World", "18"); or ...Rows.Add({"1", "Hello", "World", "18"}); I get errors like ...Rows.Add() does not take n parameters where n is equal to the number of values I put in. The last one gives me errors about the {} being all wrong. If I create the following: object[] obj = {1, "Hello", "World", 18}; ...Rows.Add(obj); Everything works fine. Cheers, Clint
-
MFC Dialog in Static LibraryThank you. It worked! Cheers, Clint
-
MFC Dialog in Static LibraryHi, I have a MFC dialog that I want to be in a static library. When it is in the static library and I call DoModal on it, the FindResource comes back with 0.
if (m_lpszTemplateName != NULL) { hInst = AfxFindResourceHandle(m_lpszTemplateName, RT_DIALOG); // Works HRSRC hResource = ::FindResource(hInst, m_lpszTemplateName, RT_DIALOG); // Fails hDialogTemplate = LoadResource(hInst, hResource); // Obviously fails... }
Is it possible to have a dialog defined in static library with MFC support? I should point out that made sure that all the resource identifiers are out of the range of all other identifiers in the program (ie, 5000+) Sincerly, Clint Singer -
MDI as SDI app?Hi All, I need to make a program that uses one document but multiple views in the same way that an MDI app would do it, ie ChildFrame/View combination. Anyone have any ideas how I would attack this? Cheers, Clint
-
CView in DLL, CDocument in EXE :: How to share?Hi All, I am writing an outlook style program and I want to be able to put CView derived classes in dll's to keep them seperate from the main application, problem is though that I also want to keep all data in the CDocument derived class which is in my EXE. Unfortunately it seems that the only things that can be accessed from the DLL's are the CDocument methods and not those in my own custom CDocument derived class. If I type cast ie. (MyDoc*)CDocument(), I get the unresolved symbol linker error, which leads me to believe I will have to put all of my data classes in each dll and compile them in there too. Is there anyway to avoid having to do this as it seems like more work than just keeping all of the CView derived classes in the main EXE, even though it seems messier. Cheers, Clint
-
Is it possible to manually resize a statusbar?I am in desperate need of being able to increase the height of my statusbar in an Doc/View MFC application. I need to owner draw the whole thing as well, but I don't think that is much of a problem. I tried looking into code like CSizingControlBar but I wasn't able to figure out what is relevant and what is not as it is extremely complicated. I would have never thought that something that should be as trivial as resizing a statusbar would be so difficult. Cheers, Clint
-
How to make a taller statusbar?I would like to know how to change the height of a statusbar. Basically I want to make an owner-drawn status bar that is a little bit taller than the default MFC one. Cheers, Clint
-
Mainframe without a toolbar?I would like to be able to create a CFrameWnd derived class that doesn't need a toolbar. Right now I have a single doc/view architecture and if I remove IDR_MAINFRAME (default menu item), I get an error about not being able to create an empty document. How does one get rid of the toolbar? Cheers, Clint
-
Keydown from CView to CFrameWndI was wondering how I get a key pressed that isn't handled by my CView derived class to be passed down to the CFrameWnd container that it is sitting in. I have a OnkeyDown in my CView class and one in my CFrameWnd class. When I fire a keydown event by typing on the keyboard, I only get the message as far as my CView class. What do I need to do so it propagates down to the CFrameWnd class? Cheers, Clint
-
Iterating through CListCtrlHi All, I would like to iterate through every item in a list control and change each item's icon based on a time criteria. I have tried GetItem() but I haven't been able to use it correctly (the documentation is very vague) as I only get an empty structure back even though I put the index I am after in iItem. Could someone please help me out here? Cheers, Clint
-
SplitterWnd within a View? OR Nested Splitter Windows?I would like to be able to put a splitter control within a view and put other views on each side of the splitter control. Basically I am trying to get nested splitter windows without having to have all of the splitter windows attached to the main frame window. Is there any way to do this? Cheers, Clint Singer
-
DeviceIoControl & OID_802_11_BSSID_LIST_SCAN ?Hi All, I am hoping that there is someone out there who will understand my problem as there seems to be very little documentation avalible to read the values of the NDIS 5.1 compatible drivers. I would like to initiate a scan of the BSSID's in my network area. The documentaion tells me I need to use OID_802_11_BSSID_LIST_SCAN to force the wirelss nic to scan the area for access points. Unforetunately I haven't been able to guess how to call this feature. The code that I tried is the following
PNDISUIO_QUERY_OID pQueryOid = NULL; pSetOid = (PNDISUIO_SET_OID)&QueryBuffer[0]; pSetOid->ptcDeviceName = _T("WLAGS461"); pSetOid->Oid = OID_802_11_BSSID_LIST_SCAN; hr = DeviceIoControl( m_hNdisUio, IOCTL_NDISUIO_SET_OID_VALUE, (LPVOID) pSetOid, sizeof(PNDISUIO_SET_OID), NULL, 0, &dwBytesReturned, NULL);
but it fails with error 0x57 (parameter not correct) and I don't know what to change. I also have the following code that I have been using to get the aquired list (or the one already in the NIC database)
PNDISUIO_QUERY_OID pQueryOid = NULL; pQueryOid = (PNDISUIO_QUERY_OID)&QueryBuffer[0]; pQueryOid->ptcDeviceName = _T("WLAGS461"); pQueryOid->Oid = OID_802_11_BSSID_LIST; hr = DeviceIoControl( m_hNdisUio, IOCTL_NDISUIO_QUERY_OID_VALUE, (LPVOID) pQueryOid, 0xFFF, (LPVOID) pQueryOid, 0xFFF, &dwBytesReturned, NULL);
and it works fine. I get a list of access points. Anyone have any suggestions? Sincerly, Clint Singer P.S. I should mention that I am also working on Windows CE (although that shouldn't make a differance except for the ptcDeviceName) paramter.
-
Syncronizing thread destruction?I was using an user interface thread to do the trick. I changed over to a worker thread and now everything seems to be better. I think the problem had to do with the self deleting nature of user threads. Now I explicitly control who deletes and when. Sincerly, Clint
-
Loading bitmaps?Hi Chris, I did go through them, unfortunately they deal with their own classes. I would like to be able to use CImage (which supports decompressing png) from the MFC library. So what I need to know is how do I tell windows that this compressed png file is in memory and not on disk without having to save a temp file to disk? Cheers, Clint
-
Loading bitmaps?Hi Everyone, I have an application that is designed to load an image from the database. This image is in a compressed form like png, jpeg etc. I was wondering what is the process to loading the bitmap if it is already in memory (ie. not loading it from the disk)? Should I use something like FileMaps or something else? Cheers, Clint :)
-
Syncronizing thread destruction?Hi Everyone, I have an application that has a thread within a thread. When I delete the parent it is suppose to delete the child thread within the destructor. Unforetunately I am running into problems where the memory has already been freed (at least that is what I think has happened) and trying to free the resources are used by the threads. When I run the application through boundschecker I don't see this problem at all so I think it has to do with some race condition. Is there some documentation on how to properly and effectively control the destruction of threads? Cheers, Clint
-
ON_THREAD_MESSAGEHi Everyone, I was wondering what the difference between ON_MESSAGE and ON_THREAD_MESSAGE is? It seems in the documentation it states that when you have a CWinThread class that you should use ON_THREAD_MESSAGE. Does this mean you should use ON_THREAD_MESSAGE everywhere, or just where the thread is posting messages? Sincerly, Clint
-
How do I post a message to a CDocument?Thank you for the clarification. Perhaps you could answer another question. I have a thread that is owned by the CDocument derived class. The threads sole purpose is to wait on some incomming data then update a structure in the document. The problem I was running into is that when I called
UpdateAllViews
I wouldASSERT()
because of some issues with multithreaded programs and c++ objects. I thought then that I could just update the data, then post a message to the document which in turn callsUpdateAllViews
. That way there wouldn't be a problem. Any suggestions? Cheers, Clint -
How do I post a message to a CDocument?Is it possible to post a message to a CDocument derived class? I am curious because I noticed that it has a BEGIN_MESSAGE_MAP()/END_MESSAGE_MAP(). Plus it would be really handy if I could have a thread post a message to the document so that it is updated. I know I can do this if I post a message to a CView, but I would like to do it to the document then have the document update the views using something like UpdateAllViews(). Cheers, Clint