|
Hi Andy,
Yes Unicode string is correct in project 1. I have used code page as 1200 for conversions. Is it possible to convert BSTR string into MBCS in a Non-Unicode project? Since project 2 is having ISAPI calls where exactly i need to pass on this MBCS string, i tried doing the same but the result was the same (No change in the outout).
Also i have tried WideCharToMultiByte() but the result is the same.
One more point project 2 cannot be made as Unicode project since ISAPI calls are used to pass on the strings to the browser.
Can you throw some more light on this issue? Thank you for your time.
Nishith
|
|
|
|
|
meet2nishith wrote: Yes Unicode string is correct in project 1. I have used code page as 1200 for conversions. Is it possible to convert BSTR string into MBCS in a Non-Unicode project?
try _bstr_t class it expose char* for non Unicode projects
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
|
|
|
|
|
I'm having a little trouble getting this code to work. The documentation on MSDN could suck a beach ball through a garden hose!
midiOutGetVolume((HMIDIOUT)MIDI_MAPPER,&OldMidiVol);
From my understanding 'MIDI_MAPPER' is supposed to find the correct device. Yet the above function returns MMSYSERR_NOTSUPPORTED. If I replace the MIDI_MAPPER with '0', it works as it should do.
This is totally confusing me. Does the 'MMSYSERR_NOTSUPPORTED' error mean the function is not supported or that 'MIDI_MAPPER' is not supported? And why if a change the value does it work?
I want this code to be portable and I'm guessing that if I simply replace 'MIDI_MAPPER' with a '0' would cause problems as this may not be true on all machines.
|
|
|
|
|
midiOutGetVolume() accepts a handle to an open MIDI device or a device ID. MIDI_MAPPER</code (which does not have the value 0, rather 0xffffffff) is neither - it is a flag passed to <code>midiOutOpen() or midiOutGetDevCaps() . This flag is not supported by midiOutGetVolume() . You'll have to open the MIDI mapper with midiOutOpen() first.
Ryan "Punctuality is only a virtue for those who aren't smart enough to think of good excuses for being late" John Nichol "Point Of Impact"
|
|
|
|
|
Hi,
Can anybody point to a links which tells
1. Building a static library in MSVC 6.0
2. Linking the same with application MSVC 6.0
As i am facing problems.
I built the static library with settings Multi threaded dll (both for release and debug).
I am trying to link with my application. It is not working at all. lot of mismatchings.
Regards, Eswari
|
|
|
|
|
|
Hi all,
Ya it's somewhat confusion question.
Here I want embed java applet in the VC++ to control the browser, browser (.html) page is also generated by VC++ coding.
If I want to the VC++ app by the browser, then what type tool I need to embed with VC++ ?
Thankx,
Awating your reply,
- Ramesh
|
|
|
|
|
Re-modified,
Ya it's somewhat confusion question.
Here I want to embed java applet in the VC++ to control the browser, browser (.html) page is also generated by VC++ coding.
If I want to control the VC++ app from the browser shown (.html) page, then what type of tool will be required to embed with VC++ ?
Thankx,
- Ramesh
|
|
|
|
|
hi, i m working on a project where i want to a html file in SDI view
sourabh jain
patni computers system
|
|
|
|
|
For this, you can use a CHtmlView instead of the standard CEditView , or use a CFormView (I think) and add one HTML controls available on Code Project to the view.
~RaGE();
|
|
|
|
|
I have a dual monitor on my system and it is very convenient to have different windows on separate monitors. On the bottom of my screen I have Find Results 1 and Find Results 2 as separated tabs (I have a picture but can't figure out how to paste it here).
If I pin both of them, they appear one of top of the other.
When debugging a program in run mode, I also have separated groups of tabs. In the debug mode if I pin both of them, they appear left and right of one another and I can adjust them to be on separate monitors.
I would very much like to be able to do the same left-right ordering in edit mode, but I can't figure out what controls it. For Find Results 1 and 2 this is especially convenient to be able to arrange on separate monitors, but as is they are above and below one another, completely wasting the space on the second monitor.
Any suggestions would be greatly appreciated.
Ilan
|
|
|
|
|
Hi
I am using Visual Studio 2005. I have developed my project in VC++ which is a dialog based MFC application.
Here on the Button Click event of one dialog i need to get the value inserted in one edit box. for that I have declared variable also and i use GetWindowTextA() functions for that and it throw assertions. Showsing NULL value in hWnd...
I don't know why this happens........any idea? The same code works fine in Visual Studio 6.0
My Code looks like this :
=========================
void CPswdWnd::OnBnClickedButton1()
{
// TODO: Add your control notification handler code here
char sCurPswd[512]="";
m_Pswd.GetWindowTextA(sCurPswd,strlen(sCurPswd)); //Here it give assertion
}
My Variables are declared by righ clicking the Editbox and then "Add Variables" and then i have made the variable as "Control".
Any idea?
Thankx in advance
Mahesh
|
|
|
|
|
void CPswdWnd::OnBnClickedButton1()
{
char sCurPswd[512]="";
m_Pswd.GetWindowText(sCurPswd,strlen(sCurPswd));
}
Without "A" at the end. The compiler decides then which one fits best.
~RaGE();
|
|
|
|
|
Since the buffer the O.P. allocated is a char buffer, they need to be using it with the ANSI version of the function. If their app is a UNICODE build, GetWindowText(...) will resolve to GetWindowTextW(...) , and will not accept the char buffer.
Identifiers like GetWindowText that are #defined to different functions (the A or W versions) depending on the build type should only be expected to work correctly under different build types when using TCHAR as the character type.
Peace!
-=- James If you think it costs a lot to do it right, just wait until you find out how much it costs to do it wrong! Avoid driving a vehicle taller than you and remember that Professional Driver on Closed Course does not mean your Dumb Ass on a Public Road! DeleteFXPFiles & CheckFavorites (Please rate this post!)
|
|
|
|
|
It is likely ASSERTing because the you are passing the return from strlen(...) as the length of the buffer. These are two different things.
You should be calling the function like: m_Pswd.GetWindowTextA(sCurPswd,512) .
Peace!
--- Modified at 10:34 Tuesday 14th February, 2006
Actually, the second parameter is the max number of characters to copy into the buffer. This is important, because it does not mean the size of the buffer. That is why using sizeof(...) as was also suggested would be incorrect in a UNICODE build.
-=- James If you think it costs a lot to do it right, just wait until you find out how much it costs to do it wrong! Avoid driving a vehicle taller than you and remember that Professional Driver on Closed Course does not mean your Dumb Ass on a Public Road! DeleteFXPFiles & CheckFavorites (Please rate this post!)
-- modified at 10:34 Tuesday 14th February, 2006
Actually, the second parameter is the max number of characters to copy into the buffer. This is important, because it does not mean the size of the buffer. That is why using sizeof(...) as was also suggested would be incorrect in a UNICODE build.
|
|
|
|
|
Amarelia wrote: m_Pswd.GetWindowTextA(sCurPswd,strlen(sCurPswd)); //Here it give assertion
Use sizeof(sCurPswd)*sizeof(TCHAR) instead of strlen(sCurPswd) .
"The greatest good you can do for another is not just to share your riches but to reveal to him his own." - Benjamin Disraeli
|
|
|
|
|
DavidCrow wrote: Use sizeof()*sizeof(TCHAR) instead of strlen().
Sorry you bug you Sir, Couldn't we use lstrlen for same?
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
|
|
|
|
|
ThatsAlok wrote: Couldn't we use lstrlen for same?
Sure you can use it, but it'll still return 0 just like strlen() .
"The greatest good you can do for another is not just to share your riches but to reveal to him his own." - Benjamin Disraeli
|
|
|
|
|
hi All,
I want to integrate crystal reports into my MFC app. I have already done this using an Access db as a data source. But what I really want to do is to use an XML file as a data source. How do i do this?
I tried to modify the connection string:
// Connection String
_bstr_t bstrAccessConnect ( L"DRIVER={Microsoft Access Driver (*.mdb)};"
L"DBQ=Database.MDB;"
L"DefaultDir=;"
L"UID=admin;PWD=;"
L"Mode=Read;");
but it didnt work. I have configured the ODBC dsn according to the CR XML v3.6 driver. It is correct because I can access the XML file as an ODBC dsn from the Crystal reports manually...So how do i do this in code???
PS: I hav Crystal Reports 8.5
|
|
|
|
|
Hi,
I have a service installed on Windows 2003 Server OS. I would like to disable the "restart service" button and menu option in the services applet.
Some services like "Event Log", RPC, etc have them disabled.
Thanks,
Mel
|
|
|
|
|
Hi Friends,
Please check the following code.
PROCESS_INFORMATION piProcInfo;
STARTUPINFO siStartInfo;
ZeroMemory( &piProcInfo, sizeof(PROCESS_INFORMATION) );
ZeroMemory( &siStartInfo, sizeof(STARTUPINFO) );
siStartInfo.cb = sizeof(STARTUPINFO);
bool bRet=CreateProcess("C:\\apps\\Microsoft Office\\OFFICE11\\WINWORD.EXE",
NULL,// command line
NULL, // process security attributes
NULL, // primary thread security attributes
TRUE, // handles are inherited
0, // creation flags
NULL, // use parent's environment
NULL, // use parent's current directory
&siStartInfo, // STARTUPINFO pointer
&piProcInfo); // receives PROCESS_INFORMATION
DWORD dw=GetLastError();
if(NULL != bRet)
{
if(WAIT_OBJECT_0==WaitForSingleObject(piProcInfo.hProcess,INFINITE))
{
MessageBox(NULL,"Finished","Error",MB_OK);
}
}
here...WaitforSingleObject does not wait for WinWord app to finish...it just quits....Any soln/Reason?
Vikram S
|
|
|
|
|
vikrams wrote: TRUE, // handles are inherited
make it FALSE
Regards
Anil
|
|
|
|
|
Still it's not working...!
|
|
|
|
|
Just a thought...
bool bRet;
"if(NULL != bRet)"
Is it OK to compare bool with NULL?
|
|
|
|
|
Good point to notice.
I didn't noticed that.
Regards
Anil
|
|
|
|