|
try:
this->ioBox->AppendText()
DO NOT USE THE dot operator (.)
since you are using a pointer you must use the -> operator.
|
|
|
|
|
Hello !
My name is Cristi and I have a big big problem.
I want to get the plug and play informations from a printer connected via parallel port (or usb). Using DeviceIoControl with IOCTL__PAR_QUERY_DEVICE_ID is great in Windows 2000 or XP, but on Windows 95,98 and Me it doesn't work at all. I tried defining myself this IOCTLs with CTL_CODE macro but in vain.
I need to query directly the device and not the driver.
Please, if anyone knows, tell me how can I obtain the plug and play information on an operating system like Windows 95, 98 or ME
You can write me at funnycreeps@go.ro
Thank you !
|
|
|
|
|
Sorry I can't post any example code, but try looking in the SetupAPI functions. Specifically:
SetupDiGetClassDevs
SetupDiEnumDeviceInfo
Remember, even if you win the rat race, you're still a rat.
|
|
|
|
|
I am currently working on a MFC application with a document/view architecture. CRichEditCtrl objects are placed on the main view as child controls according to user input. The user is allowed to scale the size of the entire view from the main menu. This is done by setting the mapping mode to MM_ANISOTROPIC and calling the SetWindowExt() and SetViewPortExt() functions with various values depending on the type of scaling wanted. These settings are modified in OnPrepareDC() within the View object.
When a user goes from a 100% scaling to a 200% scaling, the text within the CRichEditCtrl objects does not scale. But if a CRichEditCtrl object is placed on a view with no text and the view is scaled, then the text-promt is scaled correctly. When the user then enters a letter - the contents is scaled to its usual size.
The mapping mode of a CRichEditCtrl is set to MM_TEXT. My question is then: Is there any way for me to change this mapping mode, and where would I do this so that scaling is possible?
Thanks!
andigra
|
|
|
|
|
visual C++6
when i write
DDX_Text(pDX, IDC_EDIT10+4, VAR);
where VAR is a member variable, it puts the VAR value in IDC_EDIT24 not IDC14 as i expected, and when i write:
DDX_Text(pDX, IDC_EDIT5+2, VAR);
it reads it as IDC_EDIT7;
in the same way, it reads
4+1 = 15 !!
5+4=19;
10+7 = ??
anyone can help plZ?
|
|
|
|
|
What are the numeric values of IDC_EDIT10 , IDC_EDIT24 , IDC14 , IDC_EDIT5 , and IDC_EDIT7 ?
"The pointy end goes in the other man." - Antonio Banderas (Zorro, 1998)
|
|
|
|
|
It looks like the controls were not added to the dialog in the same order as they are numbered. Each IDC_EDITxx is associated with a numeric value which is incremented after each assignment to prevent reuse of a number.
If IDC_EDIT10 is associated with 33405, for example, the expression IDC_EDIT10+4 evaluates to 33409, which is apparently associated with the identifier IDC_EDIT24, not IDC_EDIT14. You can recreate the controls on the dialog in the correct order to fix this, or find another way to refer to specific controls. Or stick around - someone else may have a better solution.
Will Build Nuclear Missile For Food - No Target Too Small
|
|
|
|
|
You can adjust the numbers in the Visual C++ resource editor by going to properties, then putting '=x' after the name, where x is the number you want it to have (e.g. 'IDC_EDIT10=1000', without the quotes).
Stability. What an interesting concept. -- Chris Maunder
|
|
|
|
|
No better solution I believe... This one problem you need to avoid when using group radiobuttons.
MSN Messenger.
prakashnadar@msn.com
Tip of the day of visual C++ IDE.
"We use it before you do! Visual C++ was developed using Visual C++"
|
|
|
|
|
I have a DLL that I've made that doesn't work on other computers, saying from the VB application 'Run-time error 53: Export.dll not found'. I was told by someone yesterday that the other computer probably wasn't finding the external dependencies. So, even though the header files are included through #include directives and the paths to these files are added in my project settings, should I actually add these files to the project to make sure that my dll is standalone?
If it's broken, I probably did it
bdiamond
|
|
|
|
|
If indeed it is the case that other dependancies are required you will have to ship those DLLs with your application.
In order to find which DLLs you need, open "depends" and open your DLL into it. The tree will show all other DLLs on the system that your DLL depends on.
From that list you can determine which one(s) are missing on the other system.
Ant.
|
|
|
|
|
I kinda figured that, and I've used the dependency walker before, but what I'm trying to find out is if I go to the menu and click Project->Add to Project->Files... and actually make them a part of the project, will I still need to ship those files? Thanks for your help and patience with my idiocy
If it's broken, I probably did it
bdiamond
|
|
|
|
|
Unless you can find static lib versions of the DLLs then adding then you will need to ship the additional DLLs.
Ant.
|
|
|
|
|
alright, thanks!
If it's broken, I probably did it
bdiamond
|
|
|
|
|
Hi,
This snippet in my program...
USES_CONVERSION;
LPCTSTR lpSource = _T("123456");
char szSource[10];
strncpy(szSource,W2A(lpSource),MAX_PATH);
TRACE("%c",szSource[0]);
When I do unicode build TRACE throws error C2664: 'AfxTrace' : cannot convert parameter 1 from 'char [3]' to 'const unsigned short *'
Help me to solve this...
|
|
|
|
|
Your application is UNICODE, you passed an ANSI string to the TRACE call. Do:
TRACE(L"%c", ...);
or
TRACE(_T("%c"), ...);
Roger Allen - Sonork 100.10016
Strong Sad:
Clever I am? Next to no one.
Undiscovered and soggy.
Look up. Look down. They're around.
Probably laughing. Still, bright, watery.
Listed among the top. Ten.
Nine. Late night. Early morn.
Early mourn. Now I sleep.
|
|
|
|
|
Yep... it works...
In the following...
char str[][7] = {"123456",
"789012",
};
lstrlen(str[0]);
under unicode build throws error C2664: 'lstrlenW' : cannot convert parameter 1 from 'char [7]' to 'const unsigned short *'
How to handle this?
|
|
|
|
|
Yep... I found it...its
char str[][7] = {"123456",
"789012",
};
USES_CONVERSION;
int val = lstrlen(A2W(str[0]));
|
|
|
|
|
Manikandan wrote:
char szSource[10];
strncpy(szSource,W2A(lpSource),MAX_PATH);
You've got a buffer overrun bug waiting to happen there. You have a 10-char array but you're telling strncpy that you have MAX_PATH chars available, which is 260.
--Mike--
Personal stuff:: Ericahist | Homepage
Shareware stuff:: 1ClickPicGrabber | RightClick-Encrypt
CP stuff:: CP SearchBar v2.0.2 | C++ Forum FAQ
----
"Linux is good. It can do no wrong. It is open source so must be right. It has penguins. I want to eat your brain."
-- Paul Watson, Linux Zombie
|
|
|
|
|
Could someone explain why
m_ifField.nMask >> 1; would produce a warning saying "warning C4552: '>>' : operator has no effect; expected operator with side-effect". Shouldn't that code shift the bits in nMask to the right by one position? The nMask value is defined as a UINT .
- Aaron
|
|
|
|
|
You probably mean m_itField.nMask >>= 1;
|
|
|
|
|
I thought about that (and it does get rid of the warning), but in the MSDN documentation is has this little snippet
int nNumA=8;
nNumA >> 2; I figured that using >> would work on the actual bits of the left hand operand and there wouldn't be a need for assignment. If that's not the case any ideas when you would actually use >>? Thanks.
- Aaron
|
|
|
|
|
monrobot13 wrote:
...any ideas when you would actually use >>?
Well, it would be legal in the following case:
if (nNumA >> 2)
... This would shift the bits to the right 2 places and if the result was a non-zero value, it would do the ... stuff.
"The pointy end goes in the other man." - Antonio Banderas (Zorro, 1998)
|
|
|
|
|
For the same reason that none of these do either:
m_ifField.nMask & 1;
m_ifField.nMask ^ 1;
m_ifField.nMask | 1;
m_ifField.nMask ~ 1; Unless the result of these operations is assigned to a variable, the net result is they do nothing.
"The pointy end goes in the other man." - Antonio Banderas (Zorro, 1998)
|
|
|
|
|
Makes sense. Guess I just misunderstood the documentation. Thanks for the clarification.
- Aaron
|
|
|
|