|
Well, this is different OS. Windows 2000 has features that Win98/95 doesn't have, code changes, etc..
I can't tell you exactly, because have no idea what is the problem in the code.
Philip Patrick
Web-site: www.stpworks.com
"Two beer or not two beer?" Shakesbeer
|
|
|
|
|
I want develop a display driver( maybe a mirror display driver). Ms said in DDK the Mirror Display Driver can get a copy of GDI Oders sent to real display driver. I want get those GDI Oders. Please help me. Tall me howto send those Orders data for my driver to my usermode application.
thanks.
email: Huang_Peng@hotmail.com
|
|
|
|
|
|
Thank you. I read the msdn article, but my driver run in kernelmode! Can not use Win32 API. You known howto use the IPC in kernel mode? Please tell me that howto do in description.
|
|
|
|
|
Hi,
I am a newbie in visual c and my "hello world" program in vc is in 2002 !! I desperately needed some help from big bro in vc regarding memory allocation.
I have created a algorithm using extensive recusive functions. I needed 3 dynamic array inside my functions and so i happily used the "new" operator to help me. ( the array size is ard 100 integers) To my dismay , the array address was allocated so close together that changing some elements in one array will affect my the other array !! I am at a loss of wat to do to avoid this (and in the first place why this happen !!)
Can any kind soul explain to me why such thing happen and what alternative do i have ??
Thank you.
A desperate newbie
|
|
|
|
|
can you show us the memory allocation code you're using?
A man is like a rusty wheel on a rusty cart,
He sings his song as he rattles along and then he falls apart.
-- Richard Thompson
|
|
|
|
|
Hi all,
really thanx a lot for you help !!
my code goes like this:
int *header, *data ;
bool *checkarray;
int *connectcomponent;
width = height = 9;
connectcomponent = new int [width*height/9];
checkarray = new bool [width*height];
data = abc.getBitmapData (); // getBitmapData returns a pointer to a int array which is the same size as checkarray;
I dun see anything wrong but when i run the program... so of the values in data was changed even though i did not issue any command to do so. when I check the address of checkarray and data, i found out that there is only a diff by 0x30 !!
bk
|
|
|
|
|
The allocation of memory side by side, is a natural phenomenon. This is something the compiler and the run time system would handle. I dunno if you can change it. I dont think it is possible .
And how does the allocation of the memory affect your code. IMO you should try and change it in a way that it is not affected by memory allocation structure.
HTH
|
|
|
|
|
It sounds like your using a pointer incorrectly. If you paste some code I'm sure we can pin-point the problem. Otherwise it's to hard to diagnose.
Todd Smith
|
|
|
|
|
Did you remember that if you allocate an array with 100 elements, the indexes will be 0 - 99 ?
|
|
|
|
|
yes i do ..
anyway to add to my previous note ..
I did not change the values of array that *data point to but i constantly change the value of the array that *checkarray point to ..
however when i print out the values of array that *data point to .. those values at the begining of the array are changed !!
Thanx a lot for your help
bk
|
|
|
|
|
Does anyone know how to do this? I would appreciated any help.
-Thanks
|
|
|
|
|
I 've always put breakpoints in my View class in an mfc mdi app, to debug. but this time, it doesnt even enter that function (OnInitialUpdate), so how can I find out where the crash is happening? Call stack says crash is in NTDll. I used to get my UI, then a postmessaged CFiledlg. but now I get the CFiledlg with no underlying UI (as if its a sendmessage), and it crashes right after chooing a file.
If I debug with a breakpoint, it alwyas exceptions and never reaches the breakpoint in the vicinity of the CFileDlg spawning. yet running with the !, it does the postmessage, and probably the crash has already happened so the UI isnt showing like it used to, below the Cfiledlg which appears all by itself.
Thanks,
ns
|
|
|
|
|
Hmm, if I understood your problem right, maybe I have a solution for you. Yes I noticed several times that creating CFileDialog on heap in a view sometimes crashes inside CFileDialog 's destructor. I still have no answer why it happens, but found a work around. Just create CFileDialog using new and destroy using delete and everything will work fine.
Philip Patrick
Web-site: www.stpworks.com
"Two beer or not two beer?" Shakesbeer
|
|
|
|
|
When it crashes, open the call stack (VC6 -> Menu View -> Debug Windows -> Call Stack or press Alt+7) and examine the flow. Somewhere down the list you should find a function which is located in your app. Double click it in the callstack window and then set a breakpoint at this location. Stop and restart the debuggee. Voila, now it will break before it crashes and you can safely step through to find the reason of the crash.
int x=1, y=5;
x^=y^=x^=y;
<a href="http://www.codeproject.com/tips/StupidXORTrick.asp" target="_blank">ClickHereForHelp();</a>
|
|
|
|
|
http://www.csdn.net/expert/topic/974/974517.xml
please!
|
|
|
|
|
English version, please ?
Christian
We're just observing the seasonal migration from VB to VC. Most of these birds will be killed by predators or will die of hunger. Only the best will survive - Tomasz Sowinski 29-07-2002 ( on the number of newbie posters in the VC forum )
Cats, and most other animals apart from mad cows can write fully functional vb code. - Simon Walton - 6-Aug-2002
|
|
|
|
|
I asked this question the other day but didn't quite get the response I was looking for...
I'm thinking the formula isn't rocket science cuz I think I almost figured it out (I don't even have a gr. 10) so hopefully someone witha degree in something science out there can help me...
I hate math BTW
The thumb sizes of scroll bars...for proportional scroll bars...how are they calculated...???
They way I see it you have 2 variables to work with...
the scroll range or amount of total (virtual) window and the visible client area....using these two variables what formula would return the proper proprtional thumb size...
This is totally confusing me...
please help
Thanx!
"An expert is someone who has made all the mistakes in his or her field" - Niels Bohr
|
|
|
|
|
You got it right!
ThumbSize = (ClientSize/WindowSize)*ClientSize
or
ThumbSize = ClientSize^2/WindowSize
and
WindowSize >= ClientSize
Example: Window = 400, Client = 100
Thumb = 25 (1/4 of ClientSize, right!)
ÿVOTD: 8 "Love never fails. But where there are prophecies, they will cease;
where there are tongues, they will be stilled; where there is knowledge, it will pass away." - 1 Cor 13:8 (NIV)
|
|
|
|
|
Thank you kindly...
You have no idea how much I appreciate this help..I don't think i've ever benn so stumped in my life...
Once again I thank...
cheers!
"An expert is someone who has made all the mistakes in his or her field" - Niels Bohr
|
|
|
|
|
[UPDATE - I think instead of multiplying client you multiply by virtual...I think returns proper values now]
One question I forgot to ask...
What happens if the variables work like this?
Client area = 200;
Virtual window = 400;
This would require 50% thumb size right...?
but according to your formula
(200 / 400) * 200 would yield 100 if my math is correct...which is incorrect...a gives a false feedback to the user who expects 25% more scroll range.
Am I wrong here...? I'm very confued now...
Thanx again
cheers
"An expert is someone who has made all the mistakes in his or her field" - Niels Bohr
|
|
|
|
|
100px is 50% of your client area (200px) so the math is correct. You didnt mention that you need the value as a percent value.
int x=1, y=5;
x^=y^=x^=y;
<a href="http://www.codeproject.com/tips/StupidXORTrick.asp" target="_blank">ClickHereForHelp();</a>
|
|
|
|
|
How do I update vars. declared in a Document from a Dialog? I would like to be able to get a pointer to my Document from w/in my Dialog. I'm using the CMyDoc *pDoc = GetDocument() statement in the Dialog class, but the compiler issues an 'undeclared identifier' message. I'd also like to go the other way, ie, pick data from the Document with which to initialize the Dialog. That's why I'm trying to setup a pointer to my Document from my Dialog. Thx,
Ralf.
ralf.riedel@usm.edu
|
|
|
|
|
do it like this:
void CMyDoc::FunctionThatLaunchesTheDialog()
{
CMyDialog theDlg;
theDlg.m_variableOne = m_something;
theDlg.m_variableTwo = m_somethingElse;
if (theDlg.DoModal() == IDOK)
{
m_something = theDlg.m_variableOne;
m_somethingElse = theDlg.m_variableTwo;
}
}
your dialogs should almost never have to know about your document class.
-c
A man is like a rusty wheel on a rusty cart,
He sings his song as he rattles along and then he falls apart.
-- Richard Thompson
|
|
|
|
|
Hello, the codegurus around the world.;)
Basically, we don't need to create CMyDialog in MyDoc class.
(Or, maybe we call some member function of CMyDoc with createing MyDialog and
call this function in the menu associated in CMyView).
Anyway, there are at least two ways to access the member value of CMyDoc.
1) Pass the parent's CWnd through the dialog class constructor.
(Or use GetParent() function of CWnd).
So, what is the parent? CMyDoc(?), CMyview or CMyFrame. No problems.
(Oops, CMyDoc will not be derived from CWnd.)
2) Use the global functions like AfxGetApp() or AfxGetMainWnd()
to get CMyFrame's CWnd and use GetDocument() functions.
So, we can enjoy MFC since we have many ways to do anything.
Please, don't send me your email about your questions directly.
Have a nice day!
Sonork - 100.10571:vcdeveloper
-Masaaki Onishi-
|
|
|
|