|
There is already a mechanism for this specified by COM: release all references/interfaces to the COM server.
[warning]
You're trying to break some COM rules. You may end up with one or more clients that are still trying to use interfaces that your server exposes a client has called the method you're trying to implement. That will of course result in a serious crash since the server simply isn't there any longer.
[/warning]
"It's supposed to be hard, otherwise anybody could do it!" - selfquote "High speed never compensates for wrong direction!" - unknown
|
|
|
|
|
As the other members have stated the problem is that you have not called the Release method to decrement the reference count. Here is some documentation:
Reference Counting[^]
Best Wishes,
-David Delaune
|
|
|
|
|
Hi there.
I'm trying to write an aplication that will automaticaly initiate a user login, if the user is logged off for a given period of time. (right now it's in c#, but it may as well be in C++)
I've tried using the ADVAPI32.DLL's function LogonUser, but apparently that is used for impresonation (am i wrong?).
So, how is that done?
In addition, i failed to find a way to check if a specific user is logged on or not.
Any idea?
If there is an easier way to do the auto-login, i will of course be glad to hear it.
Thanks,
SummerBulb
|
|
|
|
|
|
Been there.
That configuration is only good for the first logon (when you turn on the computer). If a logged-on user logs off, it won't log him back on.
|
|
|
|
|
I take my words back and aplogise.
It works perfectly.
Thanks!
|
|
|
|
|
Hi to All,
I had this question came up. What is the differrence between C++ and VC++.
What I think is that, VC++ is an IDE . It is the same as C++, with an visual environment with ease of creating applications.
I want to clarify, if I am correct?Or if any othere points we need to mention for the same question.
Thanks in advance
-----------------------------
I am a beginner
|
|
|
|
|
I suppose no one ever asked such question [^].
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
hrishiS wrote: What is the differrence between C++ and VC++.
C++ in general refers to the language, independent of compiler.There are various compilers for C++ like C++ in windows(VC++),linux(GCC) etc.
VC++ is Microsoft's Compiler of C++,with it's own libraries primarily developed for MS Operating Systems.
This http://en.wikipedia.org/wiki/List_of_compilers#C.2FC.2B.2B_compilers[^] should help you.
Hope that gives a start
"Every morning I go through Forbes list of 40 richest people in the world. If my name is not in there, I go to work..!!!"
|
|
|
|
|
QuickDeveloper wrote: VC++ is Microsoft's Compiler of C++,with it's own libraries primarily developed for MS Operating Systems.
Uhm...
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
thanks a lot for the reply
-----------------------------
I am a beginner
|
|
|
|
|
I want to show the .PDF file on every help button click.
So I have to load the .PDF file when every user clicks the help button but at the same time I have to show the related topic on which help is required.
So how should i implement this?
Please tell that how I am going to search the concern text of topic in the .PDF file or the help file.
|
|
|
|
|
I assume tbis is from within your own software?
Your problem has two parts...
1/ Capturing help requests in your program.
Have a look inside CWinApp::OnHelp, and related overridables. Put breakpoints in. See what happens when you press f1 *now*.
2/ When you work out which function to override, then use that to fire up a pdf instead. As for going to a specific place inside the PDF, have a look at: http://partners.adobe.com/public/developer/en/acrobat/PDFOpenParameters.pdf[^]
In there, it shows how to open a pdf, and go to a nameddest inside the PDF. I assume these are bookmarks, or like anchors in HTML.
I'm sure there are other help pages on the adobe website that will be even more useful. Enjoy the search!
Iain.
I have now moved to Sweden for love (awwww).
If you're in Scandinavia and want an MVP on the payroll (or happy with a remote worker), or need cotract work done, give me a job! http://cv.imcsoft.co.uk/[ ^]
|
|
|
|
|
I can see why you were voted down - you posted the indentical question 20 minutes before.
Were you upset people didn't rush to answer you?
Iain.
I have now moved to Sweden for love (awwww).
If you're in Scandinavia and want an MVP on the payroll (or happy with a remote worker), or need cotract work done, give me a job! http://cv.imcsoft.co.uk/[ ^]
|
|
|
|
|
Hi,
I am quite confused: I want to open long filenames using _taccess, so I wrap my filenames with quotes, i.e. instead of c:\test.txt, I pass "c:\test.txt" or "c:\my folder with spaces\filename with spaces.txt" to _taccess, but it tells me that the file was not found. Which is the correct way to handle long filenames? I always thought that putting them in quotation marks will work just fine, but it doesn't.
Thanks for any help
|
|
|
|
|
The \ character is used to make escape sequences (e.g. "\n" is the newline character). If you want to put a \ character in a string, you have to escape it also by writing it twice: "c:\\test.txt"
|
|
|
|
|
You only ever wrap filenames in quotes when there's a chance the spaces might be interpreted as word separators. You only ever need to do that when you're passing the filename (for example) on the command-line. Win32 or C run-time APIs that take a filename argument never need filenames with quotes.
Where would I wrap a filename in quotes? Well, if I were passing the filename as an argument to a prgram I was executing with CreateProcess, then I would.
Java, Basic, who cares - it's all a bunch of tree-hugging hippy cr*p
|
|
|
|
|
I want to show the .PDF file on every help button click.
So I have to load the .PDF file when every user clicks the help button but at the same time I have to show the related topic on which help is required.
So how should i implement this?
Please tell that how I am going to search the concern text of topic in the .PDF file or the help file.
|
|
|
|
|
deadlyabbas wrote: So I have to load the .PDF file when every user clicks the help button but at the same time I have to show the related topic on which help is required.
Probably you need a PDF library in order to do the above task (try googling for...).
As an alternative, you may launch a (possibly free) PDF reader but then you'vew the issue of showing the proper page (you may split the help in more files or pass the page number as command line argument to the reader , if the latter allows it).
As another alternative you may instead consider HTML help.
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
i am using sample code of Rs232 communication in VC++ using below link.
http://www.orgler.it/visualc01.htm#
I have an application where PC com port is connected to RS232 device. On key press(trigger) from the Device, the software should receive the data from the device.
Using this above example, i need to press Rx Bytes button to read the data. However, my application cannot provide any button on the software.
kindly suggest on how to resolve above problem.
|
|
|
|
|
I don't really get your question Let me rephrase your question to see if I correctly understood it: you have a device connected to your PC through a serial port connection. This device can send data to the PC when you press a button on it. Your problem is that you don't want to put a button in your software to tell the software to read data ? Am I right ?
If that's your problem, then one solution would be to use a thread in which you call ReadFile with an infinite timeout (the call will block until you receive some data).
|
|
|
|
|
If you have adequtley sized buffers connected to the serial ports ReadFile then you could also use OnTimer() function in your MFC. In the OnTimer() you can read the serial port and the directly update controls in the dialog in the way you want. I have serial port control stuff that works this way fine.
You could use this as a model :
#define IDT_UPDATE 1000
#define UPDATE_INTERVAL 500
BOOL CDRMEXECDlg::OnInitDialog()
{
CDialog::OnInitDialog();
SetTimer(IDT_UPDATE, UPDATE_INTERVAL, NULL) ;
return TRUE;
}
void CDRMEXECDlg::OnTimer(UINT nIDEvent)
{
switch (nIDEvent) {
case IDT_UPDATE :
KillTimer(nIDEvent) ;
UpdateData(FALSE) ;
SetTimer(IDT_UPDATE, UPDATE_INTERVAL, NULL) ;
break ;
default :
CDialog::OnTimer(nIDEvent);
}
}
|
|
|
|
|
Ya your understanding is correct. How to use use thread for RS232?
|
|
|
|
|
Read this essay: http://www.flounder.com/serial.htm[^]
It shows that serial programming is not trivial, explains mnay of the mistakes you can make, and gives good sample code.
Good luck.
Iain.
I have now moved to Sweden for love (awwww).
If you're in Scandinavia and want an MVP on the payroll (or happy with a remote worker), or need cotract work done, give me a job! http://cv.imcsoft.co.uk/[ ^]
|
|
|
|
|
Iain Clarke, Warrior Programmer wrote: It shows that serial programming is not trivial, explains mnay of the mistakes you can make, and gives good sample code.
I would like to have a beer too, sir...
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|