|
CComboBox *c = (CComboBox*) GetDlgItem(IDC_YOUR_COMBOBOX);<br />
c->LimitText(10);
-krby_xtrm-
a journey of a thousand miles is started by taking the first step.
|
|
|
|
|
CComboBox *c = (CComboBox*) GetDlgItem(IDC_YOUR_COMBOBOX);
c->LimitText(10); // or any value you want.
-krby_xtrm-
a journey of a thousand miles is started by taking the first step.
|
|
|
|
|
Hi
I am learning MFC exe application.
I have to convert ini files to xml files through my application. My sample ini file(ABCD.yak) is:
ABCD.yak
[Section1]
Key1=ABCD
Key2=20
Can anybody tell me how to convert it into an xml file using mfc.
Please tell me which functions should I make?
Thanx
|
|
|
|
|
|
I've used VC++7 to write a program that gets some iformation from another program, parse it, do calcualations, and output the result.
It's working well on WinXP and Win2K.
However, I need it to work on WinNT (my friend need it). When he tries to run the program, a message shows up "Initialization of the dynamic link library C:\WINNT40\system\OLEACC.DLL failed. The process is terminating abnormaly".
Has anybody gone through a similar situation, or knows anything about it? Do you think that I should change something in the program, or the problem is because of the dll only?
Thanks
|
|
|
|
|
// the parent class of CBtnEx is COleControl
CBtnEx::CtrlSetBitmap(.............)
{
SetWindowPos(NULL,0,0,20,20,SWP_NOZORDER ); // takes no effect.
}
CMyDialog()
{
m_btnEx.CtrlSetBitmap(.....);//
m_btnEx.SetWindowPos(NULL,0,0,20,20,SWP_NOZORDER ); // it works ,
// the only way is calling outside the class ?
// what should I do ?
}
suo
|
|
|
|
|
i want to Develop an application that contains a menu Info having following menu items
• Id
• Name
o First name
o Last name
• City
• Exit
please help me in this regard
thanks
|
|
|
|
|
try to use the CMenu class
&
update ur menu every thime the
user clicks on menu
Vikas Amin
Embin Technology
Bombay
vikas.amin@embin.com
|
|
|
|
|
|
I frequently receive a dialog box saying "this file has been modified out of the source editor , do you want to reload it?" , and after this, I find that the file is indeed changed and in turn some errors occured, how can this happen? what should I do to fix it ,
thanks a lot
|
|
|
|
|
U might have a Virus.
else try to change change the Source Folder of ur Project
Use Visual Source Safe for ur Main Project , and keeping
Backup is the best thing we can do.
Vikas Amin
Embin Technology
Bombay
vikas.amin@embin.com
|
|
|
|
|
|
even if the file is altered in your IDE, it will display such dialogs. [for example, if u change something in the dialog and try to complie it, though it doesn't throw any errors]. just click on "save all" before compiling. this will make sure what you see is what is there.
Every man should marry. After all, happiness is not the only thing in life.
--[v]--
|
|
|
|
|
I have a class written in WTL 7.0 but I want to use it in my MFC application.How can i do that. The class use WTL CString but I think it isn't recognized in MFC
I tried to add the class into my project but I got the following code when I conpiled:
fatal error C1010: unexpected end of file while looking for precompiled header directive
Can you help me?
Thanks a lot!
|
|
|
|
|
well,
I am not too sure about WTL->MFC, but you can fix the compilation error by putting
#include "stdafx.h"
at the top of the file or select "not using precompiled header" in projectsettings->C/C++
-prakash
|
|
|
|
|
Thank you for your help.
When I debug the program and close it ,it said the "HEAP[Airrf.exe]: Invalid Address specified to RtlValidateHeap( 00370000, 003750AC )". What does it mean?And How do i work it.
Thank you.
|
|
|
|
|
it probably means you've written outside the memory your app has allocated (you have a stray pointer somewhere) and you've corrupted something the OS needed to maintain the Heap.
Cleek | Image Toolkits | Thumbnail maker
|
|
|
|
|
Thank you.
So how to I deal with it? Could you give me some ways to find the error pointer?
|
|
|
|
|
this is definitely a difficult thing to track down. basically, you have to make sure any pointer you use points to a valid address before you write to it.
basic things to start with: make sure your pointers are initialized to NULL or a valid value before you use them. take a good close look at any code that dereferences a pointer (*(ptr) = ..; , ptr[x]=...; or ptr->... = ...;) - make sure that code isn't running outside the limits of any memory you've allocated dynamically...
Cleek | Image Toolkits | Thumbnail maker
|
|
|
|
|
Thank you for your help.
I will track down any code defined the pointer.
Thank you again.
|
|
|
|
|
and if you are free up a memory pointer dont forget to assign NULL to that (good practice)
-prakash
|
|
|
|
|
Thank you for your good advice.
|
|
|
|
|
Hello. This is a problem I'm encoutering. I have a program compiled on a 32-bit system. Yet, I want to detect the Process Affinity Mask and System Affinity Mask on a 64-bit System which contains 64 logical processors. The problem is that:
BOOL GetProcessAffinityMask(
HANDLE hProcess,
PDWORD_PTR lpProcessAffinityMask,
PDWORD_PTR lpSystemAffinityMask
);
and
BOOL SetProcessAffinityMask(
HANDLE hProcess,
DWORD_PTR dwProcessAffinityMask
);
These functions have a DWORD_PTR data type that is a 32-bit data type in a 32-bit system and 64-bit data type in a 64-bit system when the code is compile native mode( 32-bit or 64-bit ). Since my application is compiled in a 32-bit system, the DWORD_PTR will be a 32-bit mask. When I run this application in a 64-bit system, I get the process affinity mask and system affinity as 32-bit value. This implies that even though, I have 64-bit system with 64 logical processor, my application can only see the process affinity mask and system affinity mask for 32 logical processors.
What this implies is that my 32-bit application can only be set to run on any 32 logical processors, but I would never be able to have my application run in all processors since my process affinity mask data type is 32-bit and system process affinity is also 32-bit.
So, my questions is, how can I set my application 32-bit app to run on all 64 logical processors when my code was compiled in a 32-bit system?
One Answer which I already know: I have to compile my code 64-bit native in order to be able to make my application have the ability to choose any of the 64 logical processors to run on. But then that implies a 32-bit app would never be able to choose to run on any logical processor it chooses to in a system with 64 logical processors since the GetProcessAffinity( ... ) will only return 32-bit affinity mask. This will also apply when you are setting the process affinity, SetProcessAffinityMask( ... )
I would appreciate a quick response. Thanks.
P.S. For those trying to detect all the processors in a 64-bit system with a 32-bit application, which contain more than 32 logical processors good luck. If you are able to do it, please email me at: sergioah78@yahoo.com. If no one can do it, then that means we have a limitation when we run a 32-bit app on a 64-bit system. If we have more than 32 logical processors, we can only choose up to 32 logical processors to run the 32-bit application.
sergioah78@yahoo.com
Sergio
|
|
|
|
|
I have written a number of Active X controls using VC++6.0, including a couple of subclassed controls. I am attempting to subclass the CTreeCtrl, and wish to access the superclass methods such as GetFirstVisibleItem, GetItemText and so on. I understand the principle of the PreCreateWindow and have hooked messages. The Microsoft article MFC ActiveX Controls: Subclassing a Windows Control does not really help much.
Am I missing something here, is there a simple way of accessing specific Superclass methods?
|
|
|
|
|
The program works, but the calculation is wrong. The is written in C. Could someone tell me what I am doing wrong?
Thank You
#include "stdafx.h"
#include <math.h>
#using <mscorlib.dll>
using namespace System;
// Function prorotypes
void sphere_volume (double);
// PI is a constant
const double PI=3.14159;
int _tmain()
{
// Integer local to Main to store initial radius value
double r;
printf("Please Enter A Positive Radius Value\n");
scanf("%lf", &r);
// If Else Function To Make Sure The User Types A Positive and Not A Negative Integer.
if (r >= 0)
sphere_volume (r);
else
printf("You Must Enter A Positive Integer!!!! Not A Negative Integer!!!\n");
return 0;
}
// This Is The Fnction That Does The Calculations For The Volume.
void sphere_volume (double radius)
{
double radius_cubed;
double exponent=3;
double volume;
printf("This Is The Test To See If R Was Passed To The Function: %lf\n", radius);
radius_cubed=pow(radius, exponent);
volume=(4/3)*PI*radius_cubed;
printf("The Volume Of The Sphere is %lf\n", volume);
}
Joseph L. Gelsomino
|
|
|
|