|
_tcslen returns a size_t which I think is an unsigned int. All you need to do is change pnInt to a size_t* or an unsigned int*.
Mike
|
|
|
|
|
Hi
I am doing large application So i want to devlope my Resources like Dialog,Icons,Bitmap in .Dll and call from .exe .
So can anyone give me good example link ?
|
|
|
|
|
no need for the link do the following.
Put all the dll, menu, icons etc in the resrouce only dll,
in the initinstance of your mfc application Load the resource dll using
hRes = LoadLibrary(....);
if(hRes)
AfxSetResourceHandle(hRes);
This will make your dll resource same as ur exe resource. You can use
loadicon, loadmenu etc without passing the resouce handle.
When you want to get the resource handle
AfxGetResourceHandle();
MSN Messenger.
prakashnadar@msn.com
|
|
|
|
|
hi friend ,
i see ur response but when i have try to load modeless dialog from dll it was just get onece blink and then disapper so what should i do for that .. and plz can u send me any example of this sort of dll which loads the dialog and bmp from dll.. if u send me than it's very easy for me..
and can u tell me what should i do for learning more and more abt dll.. because currently my project becomes very big.. so i wanna convert it into dll so that i can get speed..
thanks ..
once again..
and plz give me respose as soon as possible along with example.....
|
|
|
|
|
Was, by any chance, your modeless dialog done like this?
SomeFunctionOrOther()
{
CMyModeless dialog;
dialog.Create(...);
}
If so, then it's nothing to do with DLLs or anything as complicated, it's more to do with the fact that modeless dialogs cannot be done that way.
You'd need
CMyModeless* dialog;
dialog = new CMyModeless();
dialog->Create(...);
since you want the object to exist beyond the lifetime of a frame-based object.
Of course, this doesn't even come close to covering the fact you'd need to either track the dialog object's lifetime, or make it suicidal.
Steve S
|
|
|
|
|
hello friends!
i am wanted write a program that plays wav's continuously.
i am preparing header for each and playing.due to that
in between the wav files i am getting break.for that is it
possible to prepareheader at first and then passing data
to the buffer(streaming like).If possible pls help me ASAP.
Thanks in advance
|
|
|
|
|
Hi friends,
i have developed a ActiveX Control in VC++ and placed in the browser and i am trying to drag a file into that activex control but Internet explorer opening it........it should not like that...it should display the path of that file....of course i am capturing the file path in actievX control.........
is there any script to disable the opening a file when i dragged into activex control..
please help me its very urgent............client is sit on my head....plz
Thanks
Ramakrishna.J
SoftProSys.ltd.
|
|
|
|
|
Hi all,
I have created a VC++ program in VC++ 6 using "using MFC in
a shared DLL" option. It runs on the Window XP on which it is
being developed, but if I run it on a Window 2000 PC, it prompt out error "cannot find the DLL MFC42D.DLL", what should I do ?
I dont want to link the MFC to the software in a static way.
Thanks
Patrick
|
|
|
|
|
|
Nirav Doshi wrote:
I guess, the MFC DLLs are not present in the target system.
Nor should they be, unless the machine also has Visual Studio installed. The 'debug' libraries are not distributable.
"The pointy end goes in the other man." - Antonio Banderas (Zorro, 1998)
|
|
|
|
|
pyhtang1 wrote:
"cannot find the DLL MFC42D.DLL", what should I do ?
The 'D' at the end of the DLL name signifies that you are trying to run a debug built application on the target machine.
Recompile your program in release mode and it should run OK.
(most machines should have the Microsoft runtime libraries installed)
I Dream of Absolute Zero
|
|
|
|
|
Build your project in Release mode.
It can be done as follows
build/set active configuration.
MSN Messenger.
prakashnadar@msn.com
|
|
|
|
|
Hello,
I have an application which hooks up the keyboard of a given process by injecting a DLL into the process.
Now in that DLL, I have a (shared) char buffer which stores each keystroke. I am trying to get the buffer from my application, which is failing! Is there anything I am missing here? :
Here's how my code goes:
<code>
...
#pragma data_seg(".WBA")
char g_chBuffer[0x101];
#pragma data_seg()
#pragma comment(linker, "/section:.WBA,rws")
...
BOOL _declspec(dllexport) __stdcall GetAppBuffer(char *chfBufferOut)
{
if(chfBufferOut == NULL)
{
return FALSE;
}
char *pchBuffer = g_chBuffer;
while((*chfBufferOut++ = *pchBuffer++) != 0);
return TRUE;
}
...
LRESULT _declspec(dllexport) CALLBACK GetKeyboardMsgs(int nCode, WPARAM wParam, LPARAM lParam)
{
...
static char *pchBuffer = g_chBuffer;
...
ToAscii(wParam, nScan, chKeyState, &wTemp, 0);
*pchBuffer++ = char(wTemp);
...
}
</code>
In my application code, where I am calling the function GetAppBuffer() :
...MyFunction()
{
...
static BOOL (__stdcall *fpGetAppBuffer)(char *) = NULL;
if(m_hmodDLL != NULL)
{
memset(chBuffer, STRING_TERMINATOR, 0x101);
fpGetAppBuffer = (BOOL (__stdcall *)(char *)) GetProcAddress(m_hmodDLL, "GetAppBuffer");
}
...
char chBuffer[0x101];
memset(chBuffer, 0, 0x101);
fpGetAppBuffer(chBuffer);
....
}
</code>
Please reply with any of your comments/suggestions. Is there anything wrong, that I am doing here? Please write back even if you feel the question/code is not clear/insufficient.
Thanks!
Rgds,
Nirav
* Don't wish it was easier, wish you were better! *
|
|
|
|
|
Hi!
I wanted a tree control with different back color, line color, and [+/-] icon. To archive the former, I tried CTreeCtrl::SetBkColor and CTreeCtrl::SetLineColor, then it works. But there is trouble with the default [+/-] icon.
I wanted the [+/-] inside a circle. I created 2 icons in resource for that, then tried CWnd::SetIcon big/small for +/-, but the default icon never changes. What should I do?
Thanks,
Sovann.
|
|
|
|
|
Check this article:
QA: How can I change the background color of a Tree Control?[^]
It is not only about changing the background color, it also addresses your proble and although it was written for the Pocket PC, I think you will be able to use this code on the desktop as well.
Regards,
João Paulo Figueira
|
|
|
|
|
Your code is definitely very helpful. Now I can customize the [+/-] icon.
Thanks,
Sovann.
|
|
|
|
|
hope someone can help, thank
|
|
|
|
|
I've been writing a DXi .dll (Sound module) using .Net 2003 and am just about to release Beta 1 for testing. However the damn thing won't register on any machine that doesn't have .net 2003 installed. The documentation implies that MFC71.dll and MSVCR71.dll will be needed in the distribution.
So, I'm trying to get the MS deployment tool working. It's still no go. The installation fails trying to register the .dll file. I'm presuming I need to register MFC71.dll etc ?
Any clues ?
Andy C
|
|
|
|
|
Hi
previously I asked how to convert string to unsigned long now the reverse is required. How would I convert unsigned long to string?
HAVE: unsigned long cnt = FFFF0000;
REQUIRE: a string with the value "FFFF0000"
suggestions much appreciated
Kind Regards
Kevin
|
|
|
|
|
char acBuffer[128]={0};
sprintf(acBuffer, "%d", uLong);
Check the format specification for more info
u might need %ud
Papa
while (TRUE)
Papa.WillLove ( Bebe ) ;
|
|
|
|
|
My string is type CString not a character array. Any Ideas??
|
|
|
|
|
CString temp;
temp.Format("%ud", uLong);
Papa
while (TRUE)
Papa.WillLove ( Bebe ) ;
|
|
|
|
|
CString text;
text.Format("%ux", cnt);
Roger Allen - Sonork 100.10016
Roger Wright: Remember to buckle up, please, and encourage your friends to do the same. It's not just about saving your life, but saving the quality of life for those you may leave behind...
|
|
|
|
|
I assume you are using MFC.
cnd = 0xFFFF0000;
CString strValue;
strValue.Format("%X",cnt);
MSN Messenger.
prakashnadar@msn.com
|
|
|
|
|