|
I have an MFC ActiveX project that runs in Internet Explorer. I want this control to have a toolbar that can be dockable in Internet Explorer. How do I do that ?
|
|
|
|
|
How can I maxiumize the child windows of my MDI application and then remove
the _ [] X controls from the title bar of these windows.
(_ [] X) ... You know the things a user clicks on to iconize, restore, or close a "window"
on the child documents in my MDI application?
Thanks
|
|
|
|
|
see SetWindowLong. you can use this to change window styles.
-c
Civilization is the limitless multiplication of unnecessary necessities.
Mark Twain
|
|
|
|
|
thanks for the quick reply!
I am new to Visual C++ and codeproject.
How can I find documentation on "SetWindowLong"?
Thanks!
|
|
|
|
|
Click "search" button or
check here.
Good luck.
"Dirty hands lead to important discovery..." - Thomas Edison
|
|
|
|
|
Hello, Everyone
Currently I am developing an ActiveX Control that is going to be used in MS Word. A userform (the control is added to the userform) will show, and the user can do whatever he/she wants to do. After the userform is closed, this control will be add to the document. Right now I am having some problems with making the ActiveX Control's property persistent.
My ActiveX Control has a Get/Set property called "Property1" (type BSTR), and I have a global variable called "Var1" (type CString). In the "GetProperty1" method, I am using the following code:
return Var1.AllocSysString(); Now I am trying to drawing the Var1 value in the ActiveX Control's ondraw() method using pdc->TextOut(). I have two questions about this:
1> If I declare my global variable "Var1" as a control wide gloable variable (in control class), I couldn't get the value of this variable anymore after I close the userform in MS Word, which has this ActiveX Control on it.
2> If I declare this variable as a part of "Globals" (in control.cpp), I still can get the value of this ActiveX Control even after I close the userform in MS Word. The thing is when I try to add another control on the document, the variable value is still there, it is not reset. It looks like all the controls on the document are sharing the same value, and their properties values are the same.
Can someone help me please? Thanks a lot in advance.
|
|
|
|
|
If you plan to have this property "Var1" persistent to your control, then
declare it (make it member) inside of your object not global.
Why did you decide to create that property as global instead of being a
member variable?
"Dirty hands lead to important discovery..." - Thomas Edison
|
|
|
|
|
If I don't make it global, then in MS Word, after I close the userform, the value of "Var1" will be lost. I cannot draw anything on the Control, which should be added to the document.
|
|
|
|
|
Understand now!
Is this a big problem for you to "save" the property value before you close
the userform and "set it back" when you need to display that form back again?
It looks to me that you want a different property (value) for each control that
you use but you want only one variable to store it. In that case, one of the best
approach is to have that variable as a member of your component (activex or object).
Global variable is not *in my opinion* an elegant option.
Good luck!
"Dirty hands lead to important discovery..." - Thomas Edison
|
|
|
|
|
Acturally this Property1 is like a current time property. When a user click on a macro in MS Word, the program gets the current time and I would like to keep this time value with the current control. Then 5 minutes later, this user click on this macro again, it will add another control on the document, but the time value should be different. When I set the Var1 variable as a member variable, the value cannot keep as long as I close the user form.
Any ideas?
|
|
|
|
|
I am going to have to post this message in these forum as I can't find any other better like "MC++"
When using the Visual C++ .NET version 7.0 with framework version 1.0 ( I believe there are the latest), when using the debugger and looking at unmanaged pointers, I cannot see the pointer address under memory window and also unmanaged structs cannot be displayed in the watch window.
Is there any reason why?
Thanks
Al
|
|
|
|
|
Albert Pascual wrote:
I am going to have to post this message in these forum as I can't find any other better like "MC++"
You sure do know, how to push your point, don't you?
Nish
The rumours that I am an AI bot are absolutely false. These rumours have been propogated by *them* to focus all the attention on to me, while *their* bots take over the planet. Thank y%%%% Divide by zero. Cannot proceed. Abort(y/y)?
|
|
|
|
|
Yeah! Do you think is going to work?
|
|
|
|
|
Albert Pascual wrote:
Yeah! Do you think is going to work?
I hope so. I would be interested in an MC++ forum too.
Nish
The rumours that I am an AI bot are absolutely false. These rumours have been propogated by *them* to focus all the attention on to me, while *their* bots take over the planet. Thank y%%%% Divide by zero. Cannot proceed. Abort(y/y)?
|
|
|
|
|
hi,
i'm writing a chat App and want people see eachother when they request user picture (.jpg, bmp..etc) from server. i both write server and client side.
1-Do i able to keep the picture of users in Access Database using CDAO MFC classes? or classes of DAO SDK
2-Do i able to retrive and send people again using MFC if so how?
3-Should i need to serialize the picture and send it as if it is a document in binary?
4-How should i think Uploading images of new users?
5-Any better idea of handling images and sending retrieving them on network?
Thanks for ur help,
Atilla Selem
listening to you...
|
|
|
|
|
The easiest way is to send the jpg file from the client every times that sends a message to the server.
If the bandwith is not a problem! So you don't have to keep a DB in the server side.
That's just an idea of course!
Cheers
Al
|
|
|
|
|
how will i do that?
using serialization?
but think that you should keep all the user pictures as a server since u should succeed to send any one of the user's pic to others who request.
or by somehow if u don't want to take responsibility of that you have to contact users to users and make them send pictures to eachother. But they should not be aware of that.
i am at that corner of my App and i really think the easiest and efficient way to code.
Bandwidth is not problem.
But keeping things working is much diffucult.
Thanks for all
Atilla Selem
willing to learn and teach
|
|
|
|
|
I don't know your application so I just may be talking bollocks! However if your app is:
Server listens in a socket, clients send messages to that socket, server distributes message to all the connected clients.
Then when the client application starts, opens a photo.jpg and attaches that file at ever single message going to the server, the server doesn't need to change as it distributes the message and picture together to all connected sockets (clients)
If you don't want the user to have to worry about the photo.jpg, in the server you could add all the pictures with username.jpg, when a username connects without a pictures, just push it to that user!
Good way to distribute new pictures!
Well, that's my idea, however I don't know how did you designed the APP, maybe I am far off your design and to do that will take major changes in the code. Therefor, please ignore this message
Hope this helps
Al
|
|
|
|
|
Atilla:
Use this
Use the functions CADORecordset::GetChunk and CADORecordset::SetChunk
Best Regards
Carlos Antollini.
Sonork ID 100.10529 cantollini
|
|
|
|
|
Uploaded pictures would need to be stored in a binary large object field (BLOB). In SQL these are know as varBinary, in Access it is of the Type OLE.
From an ADO point of view, you would use the AppendChunk and GetChunck calls (I think) to pull and put data in.
Hope this help,
Giles
|
|
|
|
|
Is there a way to find which directory the program you are running is located with a simple call? That is when I run a particular exe, can I find which directory the user put this exe in?
I tried _getcwd etc but it does not seems to work for me.
Thanks in advance.
|
|
|
|
|
GetCurrentDirectory
Cheers,
Tom Archer
Author, Inside C#
Please note that the opinions expressed in this correspondence do not necessarily reflect the views of the author.
|
|
|
|
|
Call GetModuleFileName(...)
Nish
The rumours that I am an AI bot are absolutely false. These rumours have been propogated by *them* to focus all the attention on to me, while *their* bots take over the planet. Thank y%%%% Divide by zero. Cannot proceed. Abort(y/y)?
|
|
|
|
|
No.
You have to get the HMODULE/HINSTANCE of the module (check the virtual memory API) and then qury that one, so it's two API functions to call.
If you however do implement it in a function, it can become just one function to call.
|
|
|
|
|
Thanks for the hint.
By any chance, do you know what the calls are exactly? How do I get the HModule etc?
THanks.
|
|
|
|