|
i don't know of a funtion doing this but have you tried
using a global mousehook? are you familiar with window hooks?
i copuld imagine catching WM_SETCURSOR will do this but i'm not sure.
some links:
WM_SETCURSOR
SetWindowsHookEx()
MouseProc()
good luck!
___________________________________________
http://www.hartwork.org
|
|
|
|
|
Hi,
I haven't been using stream i/o very often, thought it was simple.
Wanted to read in an xml-file with 0x0A line delimiters.
used a for loop
(vc++ 6.0 on xp pro)
ifstream ifsIn("x1.xml");
string strData
for (string s; ifsIn>>s; strData+=s+'\n') {}
.
Was surprised to see, that operator>> uses blanks as input delimiters.
->Normal or bug?
Hence used
for (string s; ifsIn>>s; strData+=s+ifsIn.peek()) {}
i.e. blanks and newlines reside in stream and can be appended to be preserved in result.
Tried for fun to get '\r' + '\n' from ifsIn instead of just '\n' into my strData, because it's a windows format text file. Used ifstream ifsIn("x1.xml", ios::binary), but no success: Stream was empty then.
->Normal or bug?
I didn't find any way to set a property of the stream like "Use no delimiter, slurp in whole file".
->Is there?
Thanks for your assistance
And best regards
Werner
|
|
|
|
|
Sorry, 2nd for-loop is buggy of course, actually it is,
string strData;<br />
ifstream ifsData("x1.xml");<br />
char cPeek[2];<br />
memset(cPeek, 0, sizeof(cPeek));<br />
for (string strTmp; ifsData>>strTmp; ) {<br />
cPeek[0] = ifsData.peek();<br />
strData+=strTmp+cPeek;<br />
}<br />
Regards
Werner
|
|
|
|
|
Does the RECYCLER folder always exist as C:\RECYCLER or there is a CSIDL for it that I use to query the recycle bin folder using SHGetFolderPath?
Thanks!
/f
|
|
|
|
|
|
How to read/write excel files in VC using database support.
thanx in Advance
KK
|
|
|
|
|
|
My Application's Toolbars positioning goes wrong on Win XP OS when i execute for the first time.But on win 2k etc they r fine.
If anyone has come across such a problem plz let me know on satyajit@phildigital.com
|
|
|
|
|
Hello everybody,
When a user is using the Task Manager to End a Process or a task there should be a message sent to the application – anyone knows which message is? Also there is any change to handle the message – e.g. a message loop.
Thank you.
|
|
|
|
|
Hi
I think:
when you end task e proccess from App list first a quit messege send o it & after a priod of time if you accept the windows Q about endtasking app Ended with any message,
but in proccess list proccess will be end without any message.
Iman Ghasrfakhri
|
|
|
|
|
I see.
Thank you.
Regards,
|
|
|
|
|
How can I translate the keyboard character to the current keyboard layout string? In the method CWnd::OnKeyDown I would like to translate the input character to the non English character - e.g. German. Maybe it is not possible to do it in the OnKeyDown method and I have use rather another method/mechanism, but I don't know which one. Unfotunately the given method always returns me the English character even I switched the keyboard layout to another language.
Thanks,
Abyss
|
|
|
|
|
Hi
I think LoadKeyboardLayaut function is helpful for you , you most give yor languge code to this function it change keyboard language.
LoadKeyboardLayaut(_T("00000409"),KLF_ACTIVATE);
LoadKeyboardLayaut(_T("00000429"),KLF_ACTIVATE);
Iman Ghasrfakhri
|
|
|
|
|
Hi,
I didn't know this method, but based on MSDN it loads the keyboard layout. I have to play with this maybe it will automatically translates the character to the local character...
However user can switch to another languages. How can I catch this event? Or will Windows automatically handle this situation? It only requires to have the keyboard layout loaded to the application?
Thanks for your help,
Abyss
|
|
|
|
|
Hi,
I am developing an application with several components in it. The main application will have a GUI and there are several components like BHO, MS Office Addins, Clipboard trackers etc. I have a problem here.
These components should communicate with the main application by some means. It has to pass some events or some values to the main application. I will be creating both the components and the main application and I would like to know, the best method to connect the components to the main application.
I have pretty good exposure to COM and Windows programming.
Also Is it possible to create a Singleton Automation server ?
Thanks and Regards
Jugs
"A robust program is resistant to errors -- it either works correctly, or it does not work at all; whereas a fault tolerant program must actually recover from errors."
|
|
|
|
|
Jagadeesh VN wrote:
communicate with the main application
Define "communicate" and the needs of the "communication process".
Are we talking about COM components? Will access methods do (get/set)?
Jagadeesh VN wrote:
connect the components to the main application
Define "connect".
Is this "connect" in the sense ::CoCreateInstance or is it referring to the "communication process" above?
Jagadeesh VN wrote:
Singleton Automation server
This feels like you want some kind of COM server that will act as a switchboard for the "communication process". Right or wrong?
The best way, IMO, is to register the server in the ROT and use monikers to be sure that there is only one switchboard alive.
But perhaps this is overkill. How about callback interfaces or connection points if we are talking about COM components?
--
Roger
|
|
|
|
|
Hi Roger,
Thanks for the reply.
"Define "communicate" and the needs of the "communication process".
Are we talking about COM components? Will access methods do (get/set)?"
I have a BHO and some MS office addins, which will be continously monitoring some of the events like BeforeNavigate (BHO), OnOpenNewDocument(Addin), ONCloseDocument(Addin), etc.
I have a GUI application, where all these events should be reported consistently. I was thinking of implementing the GUI application as a Singleton Automation Server using DECLARE_CLASSFACTORY_SINGLETON macro. Then the monitoring components will create an instance of this automation server and since it is implemented using singleton pattern, the monitors will be able to connect and bind to the same instance of the GUI. Then they can use EventSinks or some other interface methods to communicate with the GUI.
Also Since I am using DECLARE_CLASSFACTORY_SINGLETON, I belive the Service Control Manager will check the Running Object Table and will return the currently active instance to all the clients. Can you please confirm this.
Once again Thanks for posting a reply.
Regards
Jugs
"A robust program is resistant to errors -- it either works correctly, or it does not work at all; whereas a fault tolerant program must actually recover from errors."
|
|
|
|
|
Hi Jugs,
OK, so you have some COM servers (BHOs, MsOffice AddIns etc) and some clients (IE, MsOffice apps) that creates these servers.
And... you are talking about a new COM server (the GUI app) where the earlier mentioned servers are clients, right? Let me know if I'm way off
And... you need EventSinks in your BHOs and AddIns... Why?
Don't we have a design problem here? Who is the client/consumer and who is the server/provider?
Do you actually intend to control your clients from the GUI app server? If not; what is the purpose of the event sinks?
I don't know what you want to do with your GUI app, which means that your design may be relevant even if I find it suspicious.
Isn't the GUI app some kind of a logging application?
If so; how about using a UDP port in your GUI app (localhost) and send logging packets to that port from each server?
Each server may try to start the GUI app, but the GUI app makes sure that it is the only instance running.
Or you could write a service that write logging packets to a file readable from a GUI app.
Or some other kind of inter-process communication (WM_COPYDATA?), take your pick.
Hope you find some relevans in the above
--
Roger
-- modified at 10:34 Wednesday 5th October, 2005
|
|
|
|
|
I'm using an access database with VC6. My program has been working well until now. I get the message 'Unrecognized database format' and then the path. I presume that I have a corrupt database and I have tried to repair it but I just get the same message. Does anybody have any suggest how I can repair it, view or extract the data. I did have the same problem about a month ago, but I was able to repair it. Can anybody suggest why this is happening
==
I used CDaoDatabase to extract tables list in .mdb file
Plz Help . It is very Urgent
Praveen :C
|
|
|
|
|
parims wrote:
but I was able to repair it.
So you where able to successfully repair the db right? Did you follow up with a compact db?
Question do you have blob (i.e. “memo”, “OLE Object”) columns? Those are the biggest reason I have seen a db get corrupted. If possible change the design to eliminate those types of columns or create your own row locking mechanism so people can’t access the same row at the same time.
DEBUGGING : Removing the needles from the haystack.
|
|
|
|
|
I think you problem is that you are using ACCESS 2000 or newer (that means Jet Engine 4.x). Then you need to trigger the use of DAO 3.6 instead of DAO 3.5 which is the default of the MFC DAO classes in VS6.
If you use MFC in a shared DLL, you can easily resolve this problem by putting the line:
AfxGetModuleState()->m_dwVersion = 0x0601;
into your code before you call AfxDaoInit().
Hope this helps
MS
|
|
|
|
|
Forgot all about the version issues. Good one...
DEBUGGING : Removing the needles from the haystack.
|
|
|
|
|
Hi,
I am sure that i am clicking inside the checkbox of a particular tree item. But still sometimes the handle to the item is coming as null.
This is what i am doing...
::GetCursorPos(&point);
::ScreenToClient(m_tvItems.m_hWnd, &point);
hItem = m_tvItems.HitTest(point,&uFlags);
But why NULL??
What are the possibilities?
Thanks
-- modified at 1:29 Wednesday 5th October, 2005
|
|
|
|
|
Hi,
In WinDbg we can attach a process and set the breakpoint as "bp module!function",
how we set a similar breakpoint in Visual studio 6? The same format doesnt work in Edit->Breakpoints dialog box. Does anyone know about this?
Thanks!
|
|
|
|
|
Hi all,
I'm new to multithreading and I'm using the code provided by "Vijay Mathew Pandyalakal" (http://www.codeproject.com/threads/SynchronizedThreadNoMfc.asp) to create my own thread class. What I need to do is this. I have a thread class and I want it to access a structure which is defined in main area, which is used by the main program as well.
int main()
{
MyStructure *myStructure = new MyStructure;
myStructure->myValue = 2; //myValue is an integer member in MyStructure
MyThread * myThread = new MyThread(myStructure);// MyThread has an integer
// pointer
try
{
myThread->start();
// here I hope to add my code that will change myValue in
// myStructure. This should be detected by myThread via myThreadValue
// since both myValue in myStructrue and myThreadval in myThread refer to
// the same memory area (I hope ).
.
. refer
}
However this doesn't work. Is there a correct way to do this?
Can Vijay or some one else help me on this?
Thanks in advance ,
stkl
-- modified at 0:29 Wednesday 5th October, 2005
|
|
|
|