|
I think he meant pre-processor??
John P.
|
|
|
|
|
That's what I first guessed but then his sentence doesn't make any sense...
|
|
|
|
|
For first your question codeproject has a lot of articles about create dll.Articles on DLLs[^]
For second question what does mean convert dll to exe
|
|
|
|
|
Hi All,
I have created a MDI application. I open two child windows in the MDI (by clicking File-> New).
I will draw a rectangle in one child window.
I need to drag the rectangle from one child window and drop into another.
Any solutions or ideas???
Thank You.
|
|
|
|
|
You requirement seems to be weired. There is know way a rectangle drawn can be candidate for drag and drop operation.
|
|
|
|
|
Then your application should be both an ole server and a client.
MFC has a greate support for that. See COleDropTarget, COleDropSource documentation.
--
======
Arman
|
|
|
|
|
Just a drawn rectangle needs to be dragged?
Which part is giving you trouble - drawing the rectangle, notifying the receiving window of the
drop, dragging in general, something else?
Mark
"Do you know what it's like to fall in the mud and get kicked... in the head... with an iron boot?
Of course you don't, no one does. It never happens. It's a dumb question... skip it."
|
|
|
|
|
Notifying the receiving window of the
drop..
|
|
|
|
|
I need to draw some Unicode text with ScriptString API inside a dialog box.
I tried using these functions inside dialog procedure's WM_INITDIALOG:
WCHAR g_szCurrentString[30] =
{
'H', 'e', 'l', 'l', 'o',
0x064a, 0x064f, 0x0633, 0x0627, 0x0648, 0x0650, 0x064a,
'W', 'o', 'r', 'l', 'd',
0
};
SCRIPT_STRING_ANALYSIS GetStringAnalysis(HDC hdc, WCHAR *wstr, UINT wlen)
{
SCRIPT_CONTROL scriptControl = { 0 };
SCRIPT_STATE scriptState = { 0 };
SCRIPT_STRING_ANALYSIS scriptStringAnalysis;
ScriptStringAnalyse(
hdc,
wstr,
wlen,
wlen * 2,
-1,
SSA_GLYPHS|SSA_FALLBACK,
0,
&scriptControl,
&scriptState,
0,
0,
0,
&scriptStringAnalysis
);
return scriptStringAnalysis;
}
void Uniscribe_TextOut(HDC hdc, int xpos, int ypos, int selstart, int selend)
{
SCRIPT_STRING_ANALYSIS ssa = GetStringAnalysis(hdc, g_szCurrentString, lstrlen(g_szCurrentString));
if(selend < selstart)
{
int t = selstart;
selstart = selend;
selend = t;
}
ScriptStringOut(
ssa,
xpos,
ypos,
0,
NULL,
selstart,
selend,
FALSE
);
ScriptStringFree(&ssa);
}
void PaintWnd(HWND hWnd)
{
PAINTSTRUCT ps;
RECT rect;
HDC hdcMem;
HBITMAP hbmMem;
BeginPaint(hWnd, &ps);
GetClientRect(hWnd, &rect);
hdcMem = CreateCompatibleDC(ps.hdc);
hbmMem = CreateCompatibleBitmap(ps.hdc, rect.right, rect.bottom);
SelectObject(hdcMem, hbmMem);
FillRect(hdcMem, &rect, GetSysColorBrush(COLOR_WINDOW));
Uniscribe_TextOut(hdcMem, XBORDER, YBORDER, nSelStart, nSelEnd);
BitBlt(ps.hdc, 0, 0, rect.right,rect.bottom, hdcMem, 0, 0, SRCCOPY);
DeleteObject(hbmMem);
DeleteDC(hdcMem);
EndPaint(hWnd, &ps);
}
Code is btw from http://www.catch22.net/tuts/zips/scriptstring.zip/
It works fine in main window (WM_PAINT), but something is wrong with dialogs. I tried replacing ps.hdc with GetDC(dialogHwnd) too. Should I draw inside an owner-drawn element?
Thanks.
-- modified at 7:33 Thursday 22nd February, 2007
|
|
|
|
|
Why you are writing it in WM_INITDIALOG ?
Shouldn't this be written in WM_PAINT ?
|
|
|
|
|
Good point. I had tried it before but accidentally placed case WM_PAINT inside WM_COMMAND swtich thinking it does not work. Luckily I noticed this stupid error now.
Thanks, it works!
|
|
|
|
|
jones166 wrote: thinking it does not work.
Need to look in to code for sure, if such obvious message handlers are not getting called.
|
|
|
|
|
Hello All,
I have a dll file and a win 32 API executable file. If I try to use run the exe in other systems it gives error some library files are missing ..application cannot be used.
So can u please tell me how to make a package which will install all the required library files and also register the dll in the system regedt32.exe
Thanking you,
Suresh HC.
|
|
|
|
|
|
Thanks prasad I will go through the link.
|
|
|
|
|
|
Thanks toxcct I will go through the link.
|
|
|
|
|
I second that. Inno is easy to use and serves the purpose well, for being a freebie.
I am not ashamed to confess that I am ignorant of what I do not know.
- Marcus Tullius Cicero
|
|
|
|
|
Are the dll and exe in the same directory? What does the error message say, exactly?
Also, remember that debug MFC builds will be linked to debug MFC dll's - so you should only distribute release builds.
Finally, if you are using VS2005, the other system may not have the necessary VS2005 redistributables, so you will have to install them on the other system.
|
|
|
|
|
Yes exe and dll are in the same directory , but in the other system there is no visual studio just windows .. when I try to execute the exe its give some library files missing.
|
|
|
|
|
then you either have to compile the MFC as a static library, or provide with your exe the DLLs required (most of the time, mfcxx.dll, mscvrxx.dll, msvcpxx.dll where xx is the version of the dll)
|
|
|
|
|
|
Suresh H wrote: ...it gives error some library files are missing...
Such as?
"Approved Workmen Are Not Ashamed" - 2 Timothy 2:15
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
Lots of info here: Deployment (C++)[^]
"Do you know what it's like to fall in the mud and get kicked... in the head... with an iron boot?
Of course you don't, no one does. It never happens. It's a dumb question... skip it."
|
|
|
|
|
New to the text-to-speech program, I begin with the basic speech SDK API.
Below is the code which designed function is to read "Hello world!" and save the speech into output.wav.
I had hoped I could heard the pronunciation of the words, meanwhile the data for the voice
could be processed into .wav file. However, the result of the running of the program is that I heard
nothing, only get the output.wav, so my question is how can I get the sound to be heard and simultaneously get
the process for the outputing the sound into wave file ?
Thanks for any help!
-----------------------------------------------------------------------------------
#include <sapi.h>
#include <sphelper.h>
#pragma comment(lib,"ole32.lib")
#pragma comment(lib,"sapi.lib")
int main(int argc, char* argv[])
{
ISpVoice * pVoice = NULL;
if (FAILED(::CoInitialize(NULL)))
return FALSE;
HRESULT hr = CoCreateInstance(CLSID_SpVoice, NULL, CLSCTX_ALL, IID_ISpVoice, (void **)&pVoice);
if( SUCCEEDED( hr ) )
{
CComPtr<ispstream> cpWavStream;
CComPtr<ispstreamformat> cpOldStream;
CSpStreamFormat OriginalFmt;
pVoice->GetOutputStream( &cpOldStream );
OriginalFmt.AssignFormat(cpOldStream);
hr = SPBindToFile( L"c:\\output.wav",SPFM_CREATE_ALWAYS,&cpWavStream,&OriginalFmt.FormatId(), \
OriginalFmt.WaveFormatExPtr() );
if( SUCCEEDED( hr ) )
{
pVoice->SetOutput(cpWavStream,TRUE);
WCHAR WTX[] = L"<voice required="\"gender=female\"">Hello world!";
pVoice->Speak(WTX, SPF_IS_XML, NULL);
pVoice->WaitUntilDone( INFINITE );
pVoice->Release();
pVoice = NULL;
}
}
::CoUninitialize();
return TRUE;
}
The list for the Internet telephone service providers
|
|
|
|
|