|
does itoa and ltoa work when the value is 0?
for eg:
long d = 0; // or int value
char* stop;
char* sResult;
ltoa(d, sResult, 16); //this line generates error
is the error due to the value of d being 0 or are there other reasons?
Please help. Thanks!
|
|
|
|
|
You might want to alloc some memory for sResult before using it...
- Anders
Money talks, but all mine ever says is "Goodbye!"
|
|
|
|
|
Hi all,
I have a weird problem. When I debug my application in Visual Studio
the first time, everything works fine. When I press F5 again my
application has an access violation when I move the mouse over the
commandbar. Sometimes after stopping the debug, the visual studio
crashes also.
I use Visual Studio 6, WTL 3.1 and running on Windows98.
Franky
|
|
|
|
|
I've seen this, I think, or something like it on win98. Sometimes something seems to go squirrely with the common control dll (?) during a VC session and as soon as the mouse moves over a toolbar button in my app it faults. I think I've seen it when I switch to a release build.
Once this occurs, toolbars in other apps can start to exhibit the same behavior - which makes it hard to even use explorer.
Rebooting usually straightens things out.
My 98 system is a very 'feature packed' mixture of DLL pudding at this point, still proudly displaying april 98 on bootup. I think it was upgraded from the beta. Plus, it supports two monitors, each with its own driver, which might have an impact.
The prime suspect in my case might be a rollback from IE 5.0 that occurred sometime back, and left IE a bit crippled - thats why I suspect some sort of comctl32 messup - which certainly could impact on toolbar functionality, styles etc - though I don't know if I've seen this happen for the command bar.
Does this always occur? If you fire up your machine and don't open IE, going straight to VC instead, does that make any difference?
|
|
|
|
|
Thanks Tim for your reply. While searching the net I've found several identical questions about this problem. It seems that it only occurs on Win98. The problem is that comctl32.dll uses a global adress somewhere for the toolbar. This address invalidates when you debug an application. A solution is: before starting the debugger: run a application and activate a tooltip on a toolbar. Keep this application open while your debugging. This way the global adress keeps the same for as long as the application is open. This solution works fine for me now.
|
|
|
|
|
pls any one can mail me key used to unloak advanced MFC Progamming tutorial from formatics.com
Actually i been to this site, but its closed
thanks in advance
|
|
|
|
|
@5674093020-
|
|
|
|
|
At $60 you'd be better off buying a book, but I'll be sorely disappointed if anyone here is hypocritical enough to help you steal it. Even if their site is down, their copyright remains.
|
|
|
|
|
I guess I shouldn't be surprised - the anonymous posters strike again.
|
|
|
|
|
At $60 you'd be better off buying a book, but I'll be sorely disappointed if anyone here is hypocritical enough to help you steal it. Even if their site is down, their copyright remains.
|
|
|
|
|
when i play some games,such like StarCraft and Diabllo etc,i want to modify some data such as hit points,money,gas or any other data,how can i do this?
with
ReadProcessMemory()
WriteProcessMemory()?
but how?
|
|
|
|
|
Save your game and *then* you can cheat. How can you *possibly* expect to find and manipulate dynamically allocated memory ? It's not going to be at the same location, you know....
|
|
|
|
|
Hello All,
In our project i am given the module to write a PDF reader. I want to get the text matter present in the PDF file. I wanted to know if there are any API calls or COM interfaces given by Adobe Acrobat reader to get the text from the file.
Other way is that can anyone pl reply, telling the algorithms of various encoding/decoding methods like the flat decode algorithm etc.
Regards,
Amit Gholap.
|
|
|
|
|
I am trying to use the CMonthCalCtrl MFC class in a view instead of in a dialog but am running into a bit of trouble.
At first I read in the documentation, that you add an instance to your view class and call the controls create method. This I did and could actually get the window to respond to right clicks but the view would not display the calendar.
Then I found remembered CCtrlView, so I created a class that was derived from CCtrlView and passed MONTHCAL_CLASS and MCS_NOTODAY as parameters to the CCtrlView constructor
CMonthView::CMonthView() : CCtrlView(MONTHCAL_CLASS, MCS_NOTODAY)
...
But this doesn't work either and I have even less functionality than above.
I searched the KB, MSDN and Jeff Prosise's book but can't seem to find a solution. I am thinking that since it is a common control that I should be able to use them the same, like if I can find a solution that hosts say CAnimateCtrl in a view then this might lead me to the answer.
Thanks in advance for any assistance.
Terry
|
|
|
|
|
|
Thanks but like I said I am trying to use it in a view and not in a dialog and CFormView is a dialog.
|
|
|
|
|
I drawn multiple objects using pointers.i stored all pointers.how can i select a particular object using the pointer list?or any other simple method to serve the same purpose?
Please answer in detail.
thanks in advance.
eeshwar_g@nagar.com
|
|
|
|
|
Could you present the question in detail ? Are these pointers to bitmaps you have drawn ? To child windows that have been drawn in the sense of creation ?
I'd suggest that if you *need* this pointer list, and assuming they are all of the same object type, a map<int, pointer=""> and a pile of global const int declarations would solve your problems very nicely. You could use a string, but why slow things down ?
Christian
#include "std_disclaimer.h"
People who love sausage and respect the law should never watch either one being made.
The things that come to those who wait are usually the things left by those who got there first.
|
|
|
|
|
hai
Thanks for fast response.
I have drawn a few lines by instantiating class and I stored the pointers
to objects in a list.now I want to select a particular line using this list of pointers.If I want to select a line to resize or drag it.for that purpose how can I get the pointer to particular object?I used pointers.I have written it in vc++.
Thanks again.
bhikshapathi_g@semanticspace.com
|
|
|
|
|
Now this is a little different. I presume you've got a list of pointers to objects that tell you the points you've drawn lines between ? If not, then you do not have a prayer, but I'm not sure if you do because if you do then your original question was too vague to be answerable.
You need to iterate through your list of points and figure out if the point you have selected sits on one of the lines. I've had a quick scan of 'principles & practice' but cannot see an algorithm for finding if a point is in a line. ( I'm sure it's there, but it's early and I am tired ). One way to do it would be
a/ find out first if the point is in the bounding box of the two points.
b/ figure out the ratio between x and y.
c/ apply that ratio to the x value of your point and see if the y value corresponds within an acceptable margin.
I suspect something with paths is also possible.
Christian
#include "std_disclaimer.h"
People who love sausage and respect the law should never watch either one being made.
The things that come to those who wait are usually the things left by those who got there first.
|
|
|
|
|
I want to add column in Data Grid control... The DataSource is from ADO.... I can display all the columns if i did not set the the columns.... If i set the columns i can only set 2 columns.. How to increase the columns so that i can display more than 2 column and format the columns...
URGENT!!!!!!
THANX!!!!!
|
|
|
|
|
Hello,
Well I am a novice and here is my novice question.
I have Created an SDI app. from the File menu, choosing Open Brings up a CFileDialog.
Now how do I get the file that was selected from this Dialog.
Is there a member var of CMainFrame?
Does it Automatically update the ActiveDocument? If So What does it update?
Im basicly confused on where the filePath I selected in the CFileDialog is stored.
Any Help would be Great
|
|
|
|
|
OnOpenDocument in your document class receives a path name.
Christian
#include "std_disclaimer.h"
People who love sausage and respect the law should never watch either one being made.
The things that come to those who wait are usually the things left by those who got there first.
|
|
|
|
|
|
In the command line type
IPCONFIG /ALL
or
#include <windows.h>
#include <winsock.h>
#include <wsnetbs.h>
#include <wsipx.h>
#include <stdio.h>
#pragma comment(lib, "ws2_32.lib")
main()
{
struct hostent FAR *pHostAddr;
struct in_addr in;
char pszHostName [ 255 ];
int err;
WORD wVersionRequired;
WSADATA wsaData;
wVersionRequired = MAKEWORD(1,1);
err = WSAStartup(wVersionRequired, &wsaData);
if (err != 0)
exit(1);
if (gethostname (pszHostName, sizeof(pszHostName)) != SOCKET_ERROR)
{
printf("Local Host Name: %s\n", pszHostName);
}
else
{
printf("gethostname error: %ld\n", WSAGetLastError());
exit(-1);
}
pHostAddr = gethostbyname ( pszHostName );
if (pHostAddr == NULL)
{
printf("gethostbyname error: for %s\n",pszHostName);
exit(-1);
}
else
{
printf("Host Name: %s\n", pHostAddr->h_name);
printf("Address Type: %x\n", pHostAddr->h_addrtype);
printf("Address Length: %d\n", pHostAddr->h_length);
printf("Host Address: %lx \n", pHostAddr->h_addr);
in.s_addr = *((u_long *)pHostAddr->h_addr);
printf("Dotted Address: %s\n", inet_ntoa(in));
}
}
Cheers
Alfadhly
/*
It is Illogical to define an inventor by his invention
*/
|
|
|
|