|
Not enough info What line causes the error? What is on that line (and the line before it)? Have you looked up C2065 in MSDN?
You will get better answers if you actually provide some information for us to use.
Within you lies the power for good - Use it.
|
|
|
|
|
void func(UINT nOperation)
{
#if (nOperation == OPERATION_1)
#define OPERATION(spObj, nParam) fun1(spObj, nParam)
#elif (nOperation== OPERATION_2)
#define OPERATION(spObj, nParam) func2(spObj, nParam)
#elif (nOperation== OPERATION_3)
#define OPERATION(spObj, nParam) func3(spObj, nParam)
nFrameNo)
#else
#define OPERATION(spObj, nParam)
#endif
....
OPERATION(spObj, n) // whatever nOperation be, it always call fun1,why???
}
|
|
|
|
|
Macros don't work at runtime; they are processed before compilation. Try something like this instead:
void func (UINT nOperation)
{
switch (nOperation)
{
default:
break;
case OPERATION_1:
fun1(spObj, nParam);
break;
case OPERATION_2:
fun2(spObj, nParam);
break;
case OPERATION_3:
fun3(spObj, nParam);
break;
}
}
--
jlr
http://jlamas.blogspot.com/[^]
|
|
|
|
|
Jose Lamas Rios wrote:
case default:
No case needed here.
"Ideas are a dime a dozen. People who put them into action are priceless." - Unknown
|
|
|
|
|
|
You've mixed up precompiler directives with code. Macro expansion (and execution of other precompiler directives) happen before code is compiled.
Regards
Senthil
_____________________________
My Blog | My Articles | WinMacro
|
|
|
|
|
Hi,
I need to know how i can detect a keylogger.
I've found some basic technique in doing the same.
The technique is
1.Get the image of the user32.dll
2.Disassemble the dll( traverse the user32.dll ie find the memory location of all the api in the user32.dll)
3.If the api is hooked means it will be having a jump instruction when the original api is called.
4.If this jump instruction points to a memory location outside the image of the user32.dll then the api is hooked otherwise it is not.
5.I've found the memory address of the hooked function.
My question how can i detect the dll or exe from the function pointer address which i got from the discrepancies i found when the api is hooked.
Pls provide a solution to that.
Regards
saravanan
|
|
|
|
|
Dear All,
We have a application where VB 6 is calling VC++ 7 dll's
and entry point of the whole application is in VB 6
so is it possible to debug the VC++ 7 code from VB 6 ???
regards
Manjunath
|
|
|
|
|
Yes, the only thing to do is to go in the project settings and specify which executable must be runned for debbug session. There you provide the path to your VB6 application.
One thing very important: be sure you have exactly the same dll version in the folder of your VB6 application (or the folder where it is using it generally) and the version in the debug folder. So, each time you change a single line of code in the dll and recompile, don't forget to move the dll in the application's folder.
|
|
|
|
|
Hello !
Is there a function to read data from stdin (keyboard) without actually block until a character is typed in ? For example, getc waits until a char is typed on the keyboard. What I would like to have is a function to will look if there is data present in the input buffer. If yes, it returns the data, if no, it returns an error.
And yes, this is for a 'console' application (in fact this is an embedded platform).
Thanks
|
|
|
|
|
use kbhit() for checking input buffer
|
|
|
|
|
U can use PeekConsoleInput() and ReadConsoleInput(). These are not the blocking calls
Anil Kumar
|
|
|
|
|
When drawing to a CView you normally draw onto the whole client area of its attached CFrameWnd, ryt? Now I want to implement a Print-Layout View (in MS Word)/ Print-Preview style view wherein you could see the page, and the view doesn't occupy the whole client area of the frame window...
Any suggestions? article or link where i can get some information regarding this..
tnx a lot.. in advance
maverick
"watch the birdie!"
|
|
|
|
|
CWinApp::CreatePrinterDC will give you a dc for the active printer, and pDC->GetDeviceCaps(PHYSICALWIDTH), pDC->GetDeviceCaps(PHYSICALHEIGHT) will give you the paper dimensions.
Once you have the dimensions, fill the background with a color of your choice, and then use the dimensions to draw a white "paper" rectangle using pDC->Rectangle.
If you want zooming, you'd have to use SetWindowExt/SetViewportExt in OnPrepareDC to set your zoom level.
Pssst. You see that little light on your monitor? That's actually a government installed spy camera. Smile and wave to big brother!
Painted on the side of a dog trainer's van: SIT HAPPENS
|
|
|
|
|
Hey Thanks for this info.. Well, I don't want a print preview per se.. Just want my interface to be that way, with zooming and scrolling.. Anyway, thanks again. This will be a good help as well...
regards,
Anton
"watch the birdie!..."
|
|
|
|
|
If you look at MS Word, with a new blank document.. and then choose View->Print Layout menu.. Now, you'll see the white page on the brown/gray background.. on a 100% view
I know that on normal circumstances, the client area of CView entirely occupies the client area of the CCHildFrame..
Now with the Print-Layout View, Is it possible that the white page is drawn on the CView client area but it is NOT occupying the whole client area of CCHIldFrame so thats why we are seeing the background color of CChildFrame?
Or is the white page and the background color are all drawn together in the client area of CView?
Maverick
"watch the birdie!..."
|
|
|
|
|
Here's a very simple implementation that simulates drawing a page.
First, create an SDI project that uses CScrollview as its view class.
Make the following changes to the myview.cpp file.
1) Add two constants to the top of the file:
<br />
CPoint g_ptOrigin(50,50);<br />
<br />
CRect g_rcPaper(0, 0, 850, 1100);<br />
2) In the OnDraw function, insert the following code:
<br />
pDC->SetBkMode(TRANSPARENT);<br />
pDC->Rectangle(g_rcPaper);<br />
pDC->TextOut(50, 50, _T("This is a test"));<br />
3) Create an override for OnPrepareDC, and insert the following code after the call to the base class:
<br />
<br />
pDC->OffsetWindowOrg(-g_ptOrigin.x, -g_ptOrigin.y);<br />
<br />
4) Add a handler for the ON_WM_ERASEBKGND message and replace with the following code:
<br />
CRect rcClient;<br />
GetClientRect(rcClient);<br />
pDC->FillSolidRect(rcClient, RGB(127,127,127));<br />
return (TRUE);<br />
- Step 4 draws your gray background
- Step 3 offsets the dc origin so that drawing is relative to the top left of the paper, not the top left of the client area
- Step 2 draws the paper, with the offset in place
Pssst. You see that little light on your monitor? That's actually a government installed spy camera. Smile and wave to big brother!
Painted on the side of a dog trainer's van: SIT HAPPENS
|
|
|
|
|
Hi, There.
I Wrote a service in XP, That runs a program.
For Network Access I need to logon as specific user.
Have anybody An idea, suggestion,link,API,help ... ?
Logon Can Be on local or remote computer.
Thanks,
|
|
|
|
|
Check the lpServiceStartName parameter of CreateService()[^]. Make sure this user has access to to required network resource.
suhredayan There is no spoon.
|
|
|
|
|
Thanks a lot
But, Do You Mean That I Can LogOn To System via
CreateService() ? i.e I Can Determine the UserName
and Password In this Function !!!Or a service Can Act
As Users? It is Something new for ME,
Would you pls, Discuss A little about your Idea?
|
|
|
|
|
M.Mehrdad.M wrote:
Do You Mean That I Can LogOn To System via
CreateService()
By default when you double click a exe it runs under the same user account by which you logged on the the system. But a service starts executing before a user login to the system. So you have to say to the system, under which user account the service should be run, this should be done while the service is created/registered to the system.
CreateService() is the API to Create/register the service with the system and
lpServiceStartName & lpPassword are parameters through you say to the system, under which user account the system should run your application as service.
suhredayan There is no spoon.
|
|
|
|
|
Is LogonUser() what you are looking for?
"Ideas are a dime a dozen. People who put them into action are priceless." - Unknown
|
|
|
|
|
Hello all!
I have a problem regarding the Menus in visual c++ 6.0
I have created the menu and its sub menus. Now I want to Disable (GRAYED) the menu item when required. I have found the function and using it as follows
EnableMenuItem((HMENU)IDR_MENU, ID_OPTIONS_STARTNEWTRACKING, MF_BYCOMMAND | MF_GRAYED);
but it is not working....I have also attached function behind the menu item.
Plz help me in this regard
Amin
|
|
|
|
|
m_amin83 wrote:
Now I want to Disable (GRAYED) the menu item when required. I have found the function and using it as follows
EnableMenuItem((HMENU)IDR_MENU, ID_OPTIONS_STARTNEWTRACKING, MF_BYCOMMAND | MF_GRAYED);
In MFC applications you don't usually call EnableMenuItem() directly. Take a look at How to Update User-Interface Objects[^]
--
jlr
http://jlamas.blogspot.com/[^]
|
|
|
|
|
i'm a novice programmer on Visual studio.net c++ and i need to connect it to mysql 4.1, it can be done with myodbc, bytefx or oledb, to make the normal operations (insert, select, delete, update;)).
please help fast, it's really importante, and a sample application would be great, send it to horus.cv@gmail.com, but the code and the explanation is also good.
thanks;)
|
|
|
|