|
hi..
Know Im able to disable bluetooth throughcode,but it ask for a restart.
But I dont want to restart the system..
can anyone help me in this regard.
And after sum search I found a function named BluetoothSetServiceState() It is used to disable bluetooth..
but it is not working,neither it is giving any error..
Does any 1 have any idea about this function,how to use it?
Thanks in advance
Nidhi.
|
|
|
|
|
tanu misra wrote: And after sum search I found a function named BluetoothSetServiceState() It is used to disable bluetooth..
but it is not working...
What does it return?
"One man's wage rise is another man's price increase." - Harold Wilson
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
"Man who follows car will be exhausted." - Confucius
|
|
|
|
|
Syntax-
DWORD BluetoothSetServiceState(
HANDLE hRadio,
BLUETOOTH_DEVICE_INFO *pbtdi,
GUID *pGuidService,
DWORD dwServiceFlags
);
Return Value
Returns ERROR_SUCCESS upon successful completion. The following lists common errors.
Return code Description
ERROR_INVALID_PARAMETER The dwServiceFlags are not valid.
ERROR_SERVICE_DOES_NOT_EXIST The GUID specified in pGuidService is not supported.
E_INVALIDARG dwServiceFlags is set to BLUETOOTH_SERVICE_DISABLE and the service is already disabled, or dwServiceFlags is set to BLUETOOTH_SERVICE_ENABLE and the service is already enabled.
|
|
|
|
|
Um, why are you sending this to me?
"One man's wage rise is another man's price increase." - Harold Wilson
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
"Man who follows car will be exhausted." - Confucius
|
|
|
|
|
hi
I though u asked me that what does this function return..
|
|
|
|
|
I did. You were supposed to tell me what it returns when you use it.
"One man's wage rise is another man's price increase." - Harold Wilson
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
"Man who follows car will be exhausted." - Confucius
|
|
|
|
|
Hi..
it returns me following error
ERROR_SERVICE_DOES_NOT_EXIST,which means GUID does not exist..
|
|
|
|
|
hi..
NEED HELP those who have laptops with inbuild bluetooth plz tell me the services used by bluetooth you can find bluetooth sevices in task manager these services will start from BT... or bt... and manufacture of driver used by bluetooth..
Thanks
|
|
|
|
|
as I've heard, the class wofstream narrows every thing when it writes to a file. that is it converts every wide character to a single byte one and then writes it to the file. in this way you can't have such a thing as:
<br />
wofstream out(L"foo.txt");<br />
out << L"unicode string";<br />
so there is one question: what's this WIDE class useful for?!! how you name it WIDE version of "ofstream" while it can't be used with wide characters?
and one more thing: why it takes a parameter of type char* as the file name? it's a wide class any way
|
|
|
|
|
wofstream is a type definition of the basic_ofstream class with the wchar_t data type.
And so it supports wide characters.
The 2 statements that you have written are definitely possible.
|
|
|
|
|
no it's not! it just creates an empty file. I've tried it 10's times.
|
|
|
|
|
Have you tried writing the BOM (Byte Order Mark) header in the beginning of the file?
|
|
|
|
|
yes I have. to be more clear, this damn class writes ASCII characters quiet well. the problem I have is about non-English characters.
<br />
wofstream of (L"FileName.txt");<br />
of << L"English";
of << L"فارسی";
of.close();<br />
|
|
|
|
|
Have you tried calling std::basic_fstream<type>::imbue with the locale of the text you want to write?
Have a read of Kreft and Langer "Standard C++ IOStreams and Locales" for as many details as you can take and then a few more.
Cheers,
Ash
|
|
|
|
|
no I have not, and thank you for your clue. I'll read it as soon as return back my home. and one more thing, could you please show me some more resources on these new things (STL::locals). I've no previous experience on that.
|
|
|
|
|
Sorry, I don't know a good online resource for locales which is why I recommended Kreft and Langer's book.
However, Emilio (who posts on here a fair bit) wrote an article about plugging a UTF-8[^] codecvt facet for locales which may give you enough information to get started with part of locales. You can try modifying his code to read and write UTF-16/UCS2/UCS4 depending on your particular needs.
Cheers,
Ash
|
|
|
|
|
thank you so much. for you
|
|
|
|
|
It can be used with wide characters, no problem at all. The C++ 98 standard library assumes that all filenames are narrow characters so the first line you've presented won't compile on a standard conforming compiler - however some compilers provide the second form as an extension to the library. What's particularly brain-dead about the constructors are the fact that they take C style strings and not std::basic_strings, but that's another story.
The line you've presented works perfectly - it handles wide characters pretty well in my experience. What it stores them in the file doesn't really matter (as far as the standard library is concerned) provided you can read them back in the same form.
Cheers,
Ash
|
|
|
|
|
no, don't get it wrong. in my case, when I have such a line as
of << L"فارسی";
It does not write ANY THING AT ALL into the file. strange, ha?
|
|
|
|
|
Take a look at this article[^], you are not the first person to struggle with this.
It's time for a new signature.
|
|
|
|
|
Hello everyone!
I'm confronted by a strange problem:
When mouse is over a ToolBar of a FrameWnd, tooltip text can't be shown.
CMainFrame::OnCreate()
{
EnableToolTips();
}
BEGIN_MESSAGE_MAP
ON_NOTIFY_EX(TTN_NEEDTEXT, 0, myFun)
END_MESSAGE_MAP
BOOL CMainFrame::myFun(NMHDR *pNMHDR)
{
TOOLTIPTEXT *pTTT = (TOOLTIPTEXT *)pNMHDR;
...
pTTT->lpszText = "Prompt";
}
It works fine on my computer, even if comment the codes above off but set prompt on the toolbar resource,But it doesn't have effect on some other computers.
The computers are all runing simplified chinese edition of windows xp sp3, I use vc6 and manifest.
I'm a foreigner,I'm sorry for my poor English.
Any advice would be appreciated.
|
|
|
|
|
gaspher wrote: ON_NOTIFY_EX(TTN_NEEDTEXT, 0, myFun)
Have you tried:
ON_NOTIFY_EX_RANGE(TTN_NEEDTEXTA, 0, 0xffff, myFun)
ON_NOTIFY_EX_RANGE(TTN_NEEDTEXTW, 0, 0xffff, myFun)
"One man's wage rise is another man's price increase." - Harold Wilson
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
"Man who follows car will be exhausted." - Confucius
|
|
|
|
|
Thanks for your reply!
I have not tried, I will try it tomorrow when i come back to company.
But why use the micro ON_NOTIFY_EX_RANGE? MSDN says "Note that the ID of a tool tip is always 0" in
the article "Handling TTN_NEEDTEXT Notification for Tool Tips".
I set a breakpoint in my response function , when move cursor over the toolbar button,
my funtion can be entered. But the tooltip just can't be displayed.
|
|
|
|
|
gaspher wrote: I set a breakpoint in my response function , when move cursor over the toolbar button,
my funtion can be entered.
Then my suggestion will likely not help.
"One man's wage rise is another man's price increase." - Harold Wilson
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
"Man who follows car will be exhausted." - Confucius
|
|
|
|
|
I am trying to find an easier way to handle Abort mechanism for long running operations. I tried googling all CP articles but, still I can't find a better way to solve my problem. My application has huge code base. I have to carefully design the Abort functionality without making major changes to existing code. I want the future programmers to understand and debug the code easily. Adding more complexity, the application creates GUI / Glyphs on the fly.
Here are some solutions I found on CP:
1. Using PeekMessage loop and PumpMessage during long running operations. - Not feasible for huge apps, not easy to debug. Abort will be on and off.
2. Using worker thread for long operations, main thread becomes free, post completion status to main thread after completing long operation. - Gives most responsive app but, needs redesign of total code, exception handling will be difficult.
3. Using worker thread for creating glyphs, performing long operations and all from one single Worker Proc. - Not at all recommended. Window handles cannot be easily used from other threads without using CWnd::FromHandle() or Attach() methods. If there are any SendMessage() calls, it will lead to lead locks.
4. Using UIThread. - Will show an awkward Abort dialog every time but, solves problem very simply without having to change major code. There are other problems, The UIThread Abort dialog shows as seperate task bar button. This can be made as part of main app by making it tool window or by creating hidden window as parent. But, as the main window is busy, showing UIThread dialog when main thread is busy is something I need to solve.
I read one article: http://www.drdobbs.com/184416859[^] but can't understand the way to make it work. I request you people to take a look. In this, the author creates a new UIThread and the InitInstance waits until the long operation is done. I can't understand how this makes the main thread responsive. I tried it and it didn't work.
As you can understand, I am seeing all combinations. The Dr Dobbs article showed hope initially but did not work for me. Please guide me with your experience.
Thanks,
Murali Krishna.
|
|
|
|