|
I think the problem is in your output of the value. There are two things to remember:
1. Unicode handling is mostly limited to NT/2000 platforms.
2. If you use an ansi string function on a unicode string you will (very often) see that the function gets only the first byte of the 2 byte character. That is because the second byte is often 0x00.
You say that you have added UNICODE support, does that mean that you have defined UNICODE?, then perhaps you could try defining _UNICODE as well.
"After all it's just text at the end of the day. - Colin Davies
"For example, when a VB programmer comes to my house, they may say 'does your pool need cleaning, sir ?' " - Christian Graus
|
|
|
|
|
I suggest you have a look at Michael Dunn's string articles from here[^] and here[^]
Best regards,
Alexandru Savescu
P.S. Interested in art? Visit this!
|
|
|
|
|
van Padoea wrote:
Now s seems to be 'T'. What's going on here?
Did you see this in the debugger?
Check the "Tools/Options/Debug/Display unicode strings" option
My latest article:
SQL Server DO's and DONT's[^]
|
|
|
|
|
Doh, thank you! There was nothing wrong!
|
|
|
|
|
Dear All,
Good Day...
I need to know how i can make windows notifies me about specific things like running a programm i.e Calculator.
i want Windows to tell me that a programm just run for example.
plz help.
thank you all.
Best Regards,
Mohammad Zakarni
|
|
|
|
|
Windows itself can't tell you but you can "ask" Windows.
If you have a timer with an interval at 50 or something and check if Calculator is running with FindWindow or something. There is better ways to find a running app but I don't remnember how right now!
Rickard Andersson@Suza Computing
C# and C++ programmer from SWEDEN!
UIN: 50302279
E-Mail: nikado@pc.nu
Speciality: I love C#, ASP.NET and C++!
|
|
|
|
|
There is a way to get the Windows shell to tell you though.
Maybe quite a few....
A really icky one, was to override the .exe association via
the HKEY_CLASSES_ROOT\.exe and associate it with a program
of your own that logs, or whatever, and then proceeds to
launch the application.
I first saw this as a really mean trick.
Now where was that reference....
|
|
|
|
|
Scott H. Settlemier wrote:
override the .exe association via
the HKEY_CLASSES_ROOT\.exe
Cool!
Are you 100 % sure it works?
Tell me the link/referennce if you'll find it!!!!
Rickard Andersson@Suza Computing
C# and C++ programmer from SWEDEN!
UIN: 50302279
E-Mail: nikado@pc.nu
Speciality: I love C#, ASP.NET and C++!
|
|
|
|
|
Hi!
I am writing a DVD Player for a hardware decoding card at the moment.
I choosed DirectShow to do this, because I need a SourceFilter which is able to handle CSS protected discs (and is legal). So I wrote a DirectShow Render Filter, which decodes the MPEG2 streams.
Nearly all is working fine. Playback of video and audio works great with the "pure" movie.
Now I want to implement a DVD menu navigation into my filter.
I use an improved MS DVD Sample application, because many DVD menu related things are in there.
But now I have a problem:
I can´t get the button highlight informations out of the SourceFiler.
With other words:
I need the positions of the buttons (as rectangle values) for the actual selected DVD menu.
I tried the IDVDInfo2::GetButtonRect() function, but its not implemented in DirectX yet (hmm). Same with IDVDInfo2::GetButtonAtPosition() (double hmm).
Then i tried to get/set the AM_KSPROPSETID_DvdSubPic from the IKsPropertySet but this is not supported by both SorceFilter I tried.
Btw as SourceFilter I use MS DVD Navigator or InterVideo DVD Navigator.
My Questions is now:
Does anybody know a way how to get the DVD menu button highlight informations out of the SourceFilter?
Any suggestions? Please!
Bye FBD
|
|
|
|
|
Hi,
Please can someone help me with this stupid problem. I want to use a vector on this way: vector<cstring> StringVector.
I get the follow errors and have the vector included on this way: #include <vector> in the header.
error C2143: syntax error : missing ';' before '<'
error C2501: 'vector' : missing storage-class or type specifiers
etc..
thanks,
Willem
|
|
|
|
|
Hi!
This message looks like a not correct included header file.
Maybe another .h file ,loaded before, is not correct "finished" (missed to set a ; )
You should check the order of the .h files you include.
What kind of type is vector?
Maybe it is a class name in another .h file?
Bye FatBastard
|
|
|
|
|
The < characters have been eaten! Next time tick on the "Notify me by e-mail if someone answers this message" check box before submitting your post.
As for your problem, you've got to define your vector type as
std::vector<CString> StringVector; Regards,
Joaquín M López Muñoz
Telefónica, Investigación y Desarrollo
|
|
|
|
|
I think you need to add the followin line:
using std::vector;
Best regards,
Alexandru Savescu
P.S. Interested in art? Visit this!
|
|
|
|
|
Guys,
What would cause my PC's graphic display to behave all funny and the system eventually to crash?
Are there any tools that would be able to give me some kind of direction in locating the problem.
What can I do using MS VC++ tools.
The program that I run is quite big with 65 threads, a plethora of supporting files, MDI interface, and dialog boxes.
I am running NT with Service Pack 6.0, VC++ 6.0
Any general advice will be appreciated.
Thanks
Louis
|
|
|
|
|
louis wrote:
What would cause my PC's graphic display to behave all funny
The problem may come from the use of graphical objects (as pens or fonts), selected in a device context which is released without reassigning before the original GUI objects.
For example, the following (dummy) code is wrong:
{<br />
CDC myDC;<br />
CPen myPen;<br />
<br />
myPen.CreatePen(PS_SOLID, 1, RGB(0, 0, 0));<br />
myDC.SelectObject(myPen);<br />
myDC.LineTo(0, 0);<br />
}
This one is good
{<br />
CDC myDC;<br />
CPen myPen;<br />
CPen *pOldPen;<br />
<br />
myPen.CreatePen(PS_SOLID, 1, RGB(0, 0, 0));<br />
pOldPen = myDC.SelectObject(myPen);<br />
myDC.LineTo(0, 0);<br />
myDC.SelectObject(pOldPen);
}
HTH,
Ohé Partisans, Ouvriers et Paysans
C'est l'alarme!
Le Chant des Partisans
|
|
|
|
|
Thank you very much.
Your advice is highly appreciated.
I have gone thru the graphical objects as suggested.
All code seem to be implemented the correct way.
I intent to go thru it again to confirm.
An interesting comment by someone else is to monitor the GDI Objects in Task Manager. I however are unable to activate it in NT. Any advice here.
Thanks.
Louis
|
|
|
|
|
We had this very same kind of problem in one of our apps. We knew it was caused by a resource leak, but I had spent weeks trying to fix it. All GDI objects I allocated were check/destroyed etc, but it still persisted until quite recently when we found the culprit:
SHGetFileInfo(path, 0, &fileinfo, sizeof(fileinfo), SHGFI_ICON | SHGFI_SMALLICON | SHGFI_SHELLICONSIZE);
It seems that this system procedure allocates an icon that you need to destroy yourself. If your using this call make sure you call the corresponding DestoryIcon() on the member var listed in the MSDN fo a SHFILEINFO object.
Roger Allen
Sonork 100.10016
In case you're worried about what's going to become of the younger generation, it's going to grow up and start worrying about the younger generation. - Roger Allen, but not me!
|
|
|
|
|
Thank you very much.
I do appreciate your advice.
I have gone thru your suggestions.
All code are implemented the correct way, i.e all are destroyed afterwards except for one occurence. This i have corrected but the problem still remains.
An interesting comment by someone else is to monitor the GDI Objects in Task Manager. I however are unable to activate it in NT. Any advice here.
Thanks.
Louis
|
|
|
|
|
I've had this same problem myself. You have a resource leak (as others have noted). If you want to debug your resource consumption, you can use the task manager. Now, I'm not sure that this is the same in NT, but under Win2K open the Task Manager and select the "Process" tab. Then click the "View | Set Columns..." menu item. In the resulting dialog, make sure you have "GDI Objects" checked and click "Ok". Now, run your application and watch the "GDI Objects" column. You will, in all liklihood, see your object count go up to something like 8000 or 9000 and then crash. At least that's what happened to me.
As others have noted you need to release your resources when you're done using them including any new DCs you've created. Make sure you call ReleaseDC on any new DCs you've created with CreateCompatibleDC, or any other DC creation mechanism, when you're done with it. This is where the vast majority of my problems were. Once I fixed them all, my app only used 34 GDI objects (on average).
Hope this helps.
-Matt
------------------------------------------
The 3 great virtues of a programmer:
Laziness, Impatience, and Hubris.
--Larry Wall
|
|
|
|
|
Hi Everybody,
I work in VC++(MFC). I wish to block the internet access of a machine. The machine can be connected to the internet through a dial up connection or a cable internet connection. Can anybody help me in achiving this.
Thanking all in anticipation.
Regards,
Onkar
|
|
|
|
|
I think that you're asking this question in the wrong forum. Actually, I'm not so sure that you've got the right web site. Your question relates more to networking--specifically IP filtering. This type of thing is usually accomplished with hardware such as a router. If you don't have control over the hardward or the network domain, I think that you're out of luck. I personally use a Linksys cable/dsl router that provides IP filtering on the firmware. This allows me to determine which IPs can surf the internet and which can't.
This could probably be accomplished by writing code and puting a computer running that code between the computer you want to block and the internet, but why would you want to do that. Decent hardware to accomplish the same is cheap.
Anyhow, I think you've got the wrong forum. Good luck, though.
-Matt
------------------------------------------
The 3 great virtues of a programmer:
Laziness, Impatience, and Hubris.
--Larry Wall
|
|
|
|
|
For a dialout connection, I guess you could just keep the port
on which the modem is attached open (hence unavailable).
For a NIC, hmm... maybe you could open
every socket (all 65536 of them)
and keep them open as well?
|
|
|
|
|
int WideCharToMultiByte(
UINT CodePage, // code page
DWORD dwFlags, // performance and mapping flags
LPCWSTR lpWideCharStr, // wide-character string
int cchWideChar, // number of chars in string
LPSTR lpMultiByteStr, // buffer for new string
int cbMultiByte, // size of buffer
LPCSTR lpDefaultChar, // default for unmappable chars
LPBOOL lpUsedDefaultChar // set when default char used
);
cchWideChar is int so it must less than 65535.But I have BSTR the data is large than 65536. How can I convert to char.
Pz give me some hints.
THX.
|
|
|
|
|
It's a short that needs to be less than 32767, or 65535 if it is unsigned.
Christian
No offense, but I don't really want to encourage the creation of another VB developer. - Larry Antram 22 Oct 2002
Hey, at least Logo had, at it's inception, a mechanical turtle. VB has always lacked even that... - Shog9 04-09-2002
Again, you can screw up a C/C++ program just as easily as a VB program. OK, maybe not as easily, but it's certainly doable. - Jamie Nordmeyer - 15-Nov-2002
|
|
|
|
|
O. yes.int needs to be less than 32767. Then it more hard to convert WideChar to MultiByte. Have any way to do this ?
|
|
|
|