|
If you mean the standard list control, derive your view from CListView , and add columns in the view's OnInitialUpdate() function.
--Mike--
The Internet is a place where absolutely nothing happens.
-- Strong Bad
1ClickPicGrabber - Grab & organize pictures from your favorite web pages, with 1 click!
My really out-of-date homepage
Sonork-100.19012 Acid_Helm
Hi! I'm a sig virus. Attach me to the end of your sig to help me take over the world!
|
|
|
|
|
Hi friends,
I am working in VC 6.0 SDI, I am having three pages (different bitmaps as background), I am using Function keys to select the pages. I am using BitBlt function to show the Bitmaps on the screen. I am drawing on the foreground of this bitmaps. My doubt is when I switch between the pages I want to remember the content I drawn already. Can I use BitBlt function for remembering this content with my screen as source and memory as destination so that I can use this memdc for drawing. I tried but it didn't seem to work. Can any body suggest what to do??
cheers,
Satya
|
|
|
|
|
I want a nice GUI on SDI view. Is it possible to make the layout on canvas (ie adding edit , button, radio etc controls) and embedding it on view ?? Or any alternate way...
Please comment!
|
|
|
|
|
Since it sounds like you're using MFC, check out CFormView. You use the dialog editor to lay out the controls, then the dialog gets placed in a frame window.
--Mike--
The Internet is a place where absolutely nothing happens.
-- Strong Bad
1ClickPicGrabber - Grab & organize pictures from your favorite web pages, with 1 click!
My really out-of-date homepage
Sonork-100.19012 Acid_Helm
|
|
|
|
|
I'm adding a menu item to the IE standard context menu (See: Adding Entries to the Standard Context Menu http://msdn.microsoft.com/workshop/browser/ext/tutorials/context.asp?frame=true[^]) and I want this to launch my application. I can get it to open a HTML page stored in a resource in my application, in a HTML dialog, but that's not what I want.
What I'm trying to do is:
a) User selects text in IE and right clicks on it.
b) They choose my new contect menu item.
c) My app starts, if it isn't already running and gets the selected text.
Neville Franks, Author of ED for Windows. www.getsoft.com
Make money with our new Affilate program
|
|
|
|
|
I do not know enough javascript so there might be another easy alternative , but anyway here is my suggestion.
You can access COM components through Javascript's createactivex method, from inside the component you can do whatever you want. I'm not sure if you can access the shell through javascript etc which should be the straight forward method.
And instead of having to execute html inside resource, you can simply put the necessary javascript in the html page and point to that location in the registry.
Let me know if you find any other alternative.
regards
Kannan
|
|
|
|
|
Hi Kannan,
Using a COM component sounds like it will work. Unfortunately this is one area I don't have any experience. I assume ATL would be the way to go, but I have done any ATL either! It wouldn't have a UI and should only be a few lines of code. Can you give me a URL where I can read about writing a COM object which can be accessed from a HTML page. I've looked around MSDN and couldn't find anything obvious.
Neville Franks, Author of ED for Windows. www.getsoft.com
Make money with our new Affilate program
|
|
|
|
|
Hi Neville,
For creating simple components, you can start with this[^] article.
Once you have the COM component, you can call it from javascript using the techniques specified in this[^] article.
If you have trouble with COM, another option that springs to mind is to create an instance of the windows scripting host(wsh), through the above technique and call the external program.
Have a look here[^] and also here[^]
Hope this helps
regards
Kannan
|
|
|
|
|
Hi Kannan,
Thanks for the detailed reply and the links, very helpfull. I had a look at WSH however I'm unable to use the WScript object from JS in a HTML page in IE, which makes sense. If I could use WScript then I could launch my app.
To my surprise though I could use ActiveXObject("Scripting.FileSystemObject") and then create and delete files and folders.
Looks like I'll spend some time now investigating the COM route. I'll let you know where I end up.
Neville Franks, Author of ED for Windows. www.getsoft.com
Make money with our new Affilate program
|
|
|
|
|
Hi Kannan,
I've been able to build a simple COM component that gets run from javascript when the user right clicks in IE. The COM component then launches my application, so I have a solution. If you need any specific details please let me know.
Thank you very much for your help.
Neville Franks, Author of ED for Windows. www.getsoft.com
Make money with our new Affilate program
|
|
|
|
|
1. UpdateAllViews() member function has 3 parameters. After writing a Bitmap file in the CDocument class, how will I update my view with new Bitmap using UpdateAllViews().
2. I’m writing a program to display two different outputs. A Bitmap image and some textual information in an AppWizard created MDI application. I want to display this in two different child windows that popup at the same time i.e. with out using Splitter windows.
I would also like to know whether it is possible to set sizes for these child windows.
3. How do we display the percentage completed font (in numeric values) on a Progress Bar control and update it along with the progress bar ?
|
|
|
|
|
Neel Abraham wrote:
how will I update my view with new Bitmap using UpdateAllViews().
In your CView -derived class you have a OnUpdate() -handler. In this you do whatever your View needs to do when a new bitmap comes along. Maybe resizing etc. Your view does not hold a copy of the bitmap, instead it accesses the one inthe document, so it will at once display the new bitmap.
If you happen to have more than one message to send using UpdateAllViews() , you define some so called HINTS:
const LPARAM HintNewBitmap = 1;
const LPARAM HintTwo = 2; and call
UpdateAllViews(NULL, HintNewBitmap, NULL);
and in your handler you switch on the Hint.
Neel Abraham wrote:
I would also like to know whether it is possible to set sizes for these child windows.
Sure. In OnSize() you can set the sizes to whatever you want before calling the Base-class with it.
My opinions may have changed, but not the fact that I am right.
|
|
|
|
|
Hi,
There is an application that comunicates with a printer through a serial interface. If i start this application, is there anyway to spy what commands have beeing sent through the used serial port?
Thank u very much,
Dirso
|
|
|
|
|
Connect serial port 1 to 2 via crossover cable.
Write program to open ports 2 and 3 and just act
like a bridge the two-- and to report on what is
sent. Then connect your printer to port 3 and
that application to port 1.
I've not had to go this far before, but I think
that should do it for you.
|
|
|
|
|
|
Ooh, that's so much nicer if you're on Windows.
I just downloaded all those utilities and have
been playing with them. Really useful stuff.
|
|
|
|
|
I have created a table (using VC++ 6.0) with MSHFlexGrid Control where I display data. I am able to add new rows to the table during run-time by calling AddItem( string, rowIndex ). However, the user should be able to delete a row from the table and I cannot find a function that would do such a thing. Of course, I can clear the contents of the row by setting each value displayed in the cell to NULL and shift up all the next rows but that sounds like a time consuming operation and I would be left with blank rows at the end of the table. Or I could redraw the table entirely, but that doesn't sound right to me either. Can somebody please tell me how to delete a row from the table without performing all those operations? If that is possible of course.
none
|
|
|
|
|
I am sorry people but I found the answer to my question. It took me a week to find what was right in front of me. Sometimes when you look too hard for an answer which is screaming in front of you you don't see it. I would have deleted this message but I couldn't. Don't know why.
none
|
|
|
|
|
I want to create a function that will take an array pointers to any data type and resize it at runtime. But I know I can't use xalloc since I'm initially allocating the memory with new. But I also can't use new in the function when I don't know what data type I'm using, or can I? Must I overload the function with everything I use it for and rewrite the operator= for every new class I use it for? There must be an easier way to do it.
|
|
|
|
|
std::vector
std::vector<MyPtr*> vPtr;
for(int i=0; i<nPointers;i++)
{
vPtr.push_back(new MyPtr);
}
MyData = *vPtr[iIndex];
vPtr.clear();
- Nitron
"Those that say a task is impossible shouldn't interrupt the ones who are doing it." - Chinese Proverb
|
|
|
|
|
brandon1879 wrote:
I want to create a function that will take an array pointers to any data type
That's what templates are for.
template <typename ELEMENT_TYPE>
bool ResizeArray ( ELEMENT_TYPE** ppElts, size_t nCurrSize, size_t nNewSize )
{
}
--Mike--
The Internet is a place where absolutely nothing happens.
-- Strong Bad
1ClickPicGrabber - Grab & organize pictures from your favorite web pages, with 1 click!
My really out-of-date homepage
Sonork-100.19012 Acid_Helm
|
|
|
|
|
Ok, I am developing a quasi-realtime data display with some dials and sliders on it. The controls are in their own modeless dialog so users can show or hide them as they please. I am aquiring the data from a seperate datasource from within a seperate thread, and will pass the data structure to the UI via message pump. I also wrote a "window manager" class to handle which controls are shown and which ones aren't. I plan on sending a message to the "window manager" with the data structure, and then have the window manager send messages to the individual controls.
So my question is:
Do I:
A. Use SendMessage() from the DAQ thread and wait for the updates to return before acquiring the next sample, and use SendMessage() from the window manager to all the controls.
B. Use SendMessage() from DAQ and PostMessage() to the controls from the window manager, letting the control windows handle their own message que.
C. Use PostMessage() from the DAQ to the manager, and SendMessage() to the controls.
D. Use PostMessage() all around, passing the structures created on the heap and deleting them within the message handlers.
E. Some other method
Aside:
The data aquisition will more than likely take longer than the window updates, so I probably won't be flooding the message que. I plan on running between 10 Hz - 30 Hz.
- Nitron
"Those that say a task is impossible shouldn't interrupt the ones who are doing it." - Chinese Proverb
|
|
|
|
|
I think you have to use PostMessage() all around. Because SendMessage() returns only after the message procceed completely while PostMessage() only puts message into the message queue and returns.
Here data aquisition will take longer time then message processing. SendMessage() also take some time to process the message. So it probably make the whole process slower.
C.R.Naik
|
|
|
|
|
Also for process-safety, prefer using PostMessage. Windows guarantees that PostMessage can always be safely called from within any thread (even inside kernel code or with some gdi-locks unavailable) which is not true for SendMessage, because it is per-se unknown what the called dialog-procedure might do.
|
|
|
|
|
Pater wrote:
Also for process-safety, prefer using PostMessage.
I agree. I will implement it this way. Thanks!
- Nitron
"Those that say a task is impossible shouldn't interrupt the ones who are doing it." - Chinese Proverb
|
|
|
|