|
- Thanks pal!
- Your reply helps a lot. I still have a question. Another pal says, "the variable is a constant the compiler knows the value at compile time". I do not know what is meaning.
- Can you help?
- Regards,
Maer
|
|
|
|
|
- Thanks pal!
- But I think the error occurs with the statement "const int a:: s=20; "
- Do you agree with me?
- Can you help?
- Regards,
Maer
|
|
|
|
|
Anyone know how I can find what the size of the current cursor is?
Thanks
Jeremy Davis
http://www.astad.org
|
|
|
|
|
use GetSystemMetrics with SM_CXCURSOR,SM_CYCURSOR
Nish
Sonork ID 100.9786 voidmain
|
|
|
|
|
It is possible to export functions from an exe, to be used by another process, so that the exe functions a bit like a DLL? I want one file which can be run directly and also used from another applciation. Is this possible?
Sorry to dissapoint you all with my lack of a witty or poignant signature.
|
|
|
|
|
COM is the standard way to achieve this.
Michael
|
|
|
|
|
LoadLibrary does load exes according to MSDN, but they only describe it for loading resources. But I guess you should be able to use GetProcAddress for an exported func.
But I think a better design would be to put your functions in an ordinary DLL and then write a small app that loads the dll for your stand-alone case.
Cheers
Steen.
"To claim that computer games influence children is rediculous. If Pacman had influenced children born in the 80'ies we would see a lot of youngsters running around in dark rooms eating pills while listening to monotonous music"
|
|
|
|
|
How can I determine the Computername where my app is located.
Note: The Computername where the app is located is not the same where the app is executed -> Networkresource !
|
|
|
|
|
not sure if this will be useful
but take a look at WNetEnumResource and WNetGetNetworkInformation
Nish
Sonork ID 100.9786 voidmain
|
|
|
|
|
This works for me...
CString GetMachineName()
{
DWORD dwsize = MAX_COMPUTERNAME_LENGTH + 1 ;
char name[MAX_COMPUTERNAME_LENGTH + 1 ];
if (!::GetComputerName(&name[0], &dwsize))
throw E_FAIL;
}
CString strName(name);
return strName;
}
Hope this helps,
Bill
|
|
|
|
|
If this isn't a beginner's question I don't know what.
My problem is that when I start a new project "Win32 static library" with precompiled header and MFC support I can't add MFC classes to it. I can't even start the classwizard.
Shouldn't the classwizard work for static libraries? When right-clicking on my project and selecting "New class..." my only option is to add a generic class.
Someone please tell me what I'm missing / doing wrong.
Thanks!
|
|
|
|
|
If I recall correctly class wizard only works for MFC Applications and MFC extension dlls. Any other type of project requires the manual creation of MFC derivied classes. The MFC support just adds the afx includes to the stdafx.h
What kind of dervived MFC classes are you trying to create?
Michael
|
|
|
|
|
Ok, I guess you're right. If I try to create a win32 console application with MFC support it works all right.
I was planning to create a couple of CRecordset-derived classes. I'll see if I can do it manually.
Thanks for your help.
|
|
|
|
|
..Am having problems with
this piece of code ...Will be grateful if you help
.
trying to take a path into a crgn object ...
tried both createfrompath() and pathtoregion()
but the CRgn object is null ..
do help
/////////////*********************
COLORREF ref= RGB(255,0 , 0 );
CPen lpen (PS_SOLID,m_wdWidth,ref);
CPen* pOldPen = pDC->SelectObject (&lpen);
// CHairPackView *hView =(CHairPackView*)
GetHandle ();
CRgn Extract ;
HRGN hExtract ;
HDC hDevice ;
hDevice =pDC->GetSafeHdc();
//Method 1
BeginPath(hDevice);
pDC->MoveTo (m_ptFrom);
pDC->LineTo (m_ptTo);
CloseFigure( hDevice ) ;
EndPath(hDevice);
StrokePath ( hDevice ) ;
// */
// Method 2
pDC->BeginPath();
pDC->MoveTo (m_ptFrom);
pDC->LineTo (m_ptTo);
pDC->CloseFigure();
pDC->EndPath();
pDC->StrokePath();
Extract.CreateFromPath (pDC );
////null value for Extract
// hExtract =PathToRegion( hDevice );
pDC->SelectObject (pOldPen);
morphius_902
|
|
|
|
|
I'm having a bit of a chat with an AV chap, and we came around to talking about what is executable, and what isn't. Can you Execute a dll or not, I remeber reading something in MSDN about it, but can't remember the details, Can anyone clarify this !
(No we aren't arguing we are discussing)
Regardz
Colin J Davies
Sonork ID 100.9197:Colin
Bring back the EMBED tag
|
|
|
|
|
I dont think you can directly execute a DLL
But you can use rundll32 to execute functions in a DLL for some functions [donno why this is so]
I tried this and failed
rundll32 user32.dll,MessageBoxA 0,"hello","hi",0
But this worked
rundll32 user32.dll,ExitWindowsEx 2,0
Nish
|
|
|
|
|
hmmm
even rundll32 user32.dll,ExitWindowsEx 2,0 failed, but I remember using it long back. Then I was on win 95. perhaps it wont work on 2000
Nish
|
|
|
|
|
Doesn't it depend on how you define an executable? DLLs are definitely executed ("Put them up against the wall!" ), but only in the context of an exe. So if executable means stand-alone program then no. But if it means "contains code that is executable" then yes.
Using rundll32.exe to execute the code in the dll is IMHO no different from using your own app to execute it. So whether you can execute the dll using rundll32.exe or not does not is not determine executability (I bet no such word exists!), again IMHO.
Cheers
Steen.
"To claim that computer games influence children is rediculous. If Pacman had influenced children born in the 80'ies we would see a lot of youngsters running around in dark rooms eating pills while listening to monotonous music"
|
|
|
|
|
Rundll32.Exe requires functions to have a particular signature:
void CALLBACK EntryPoint(
HWND hwnd, // handle to owner window
HINSTANCE hinst, // instance handle for the DLL
LPTSTR lpCmdLine, // string the DLL will parse
int nCmdShow // show state
);
You can find this in the MSDN.
I don't think it's possible to generally call any function in a DLL. You have to use an EXE that knows the arguments the function expects, and can convert from the command line form to that required by the function.
Gary R. Wheeler
|
|
|
|
|
I read Colin's post as a philosophical question of whether you could catagorize a DLL as "an executable" in it's own right. Of course, you're right about the specifics of using rundll32.exe, but that was not my point. I don't think the statement "my dll can be called using rundll32.exe, therefore it's an executable" is valid - in this sense rundll32.exe is just another application using a dll.
And of course, you have to know the signature of the exported function you want to call. Otherwise you'll get stack problems. That's one of the reasons they invented COM, to give you runtime linking (OK, that's a little simplistic
Cheers
Steen.
"To claim that computer games influence children is rediculous. If Pacman had influenced children born in the 80'ies we would see a lot of youngsters running around in dark rooms eating pills while listening to monotonous music"
|
|
|
|
|
Does anyone knows some simple function like that ?
I have tried using both WNetGetUniversalName and WNetGetConnection APIs
but with no success. Some code would be appreciated.
Thanks,
Miroslav Rajcic
|
|
|
|
|
I've found this article in a page, but i have to pay for the article to see it, does anybody know where can i found this article free, or anybody know how do this?
|
|
|
|
|
|
Hi,
I try to use CHoverButton (published in this site) in a netscape plugin.
The plugin is in DLL format. But it doesn't work. Finally, I figure out
that the problem lies with bitmap loading. Somehow the
CHoverButton::LoadBitmap function does not load/can't find the bitmap.
I change the code to the simplest version as follows.
mybitmap.LoadBitmap(IDB_BITMAP1); //mybitmap is a CBitmap object
To my surprise, the function returns 0 (fail). I've imported the bitmap
into the resource editor as IDB_BITMAP1, and the resource.h clearly
shows the entry for it.
#define IDB_BITMAP1 105
Does it have anything to do with DLL vs Application? I tried to load the
same bitmap using the same way in normal MFC Application and it works.
How can I know whether the bitmap resource has been linked into the DLL itself?
Is there anyway to verify it through Project Settings?
Your help is appreciated.
|
|
|
|
|
my project consists of 3 services and a set of COM objects. The COM objects each host a pool of worker threads. Each object has three interfaces, one for each service.
The COM objects and the services all update the same table in a SQL Server DB. The multi-threaded objects post a message to a single thread to do their updates.
Do I need a synchronization device, such as CMutex to keep these from stepping on each other? If so, please give me a specific recommendation.
Thanks for the help,
Bill
|
|
|
|