|
It has always been my understanding that the definition of the Manifest constant _AFXDLL meant that MSVC be linked by DLL, e.g. through MSVC42.DLL etc. instead of as a static Library. Is this assumption correct?
LateNightsInNewry
|
|
|
|
|
When _AFXDLL is defined, that indicates you will be linking to the DLL version of the MFC
libraries. It needs to be defined before the MFC header files are used so the correct
definitions/declarations/etc. are used to match the DLL build of MFC.
Mark
Mark Salsbery
Microsoft MVP - Visual C++
"Remember the five Ds of dogeball: Dodge, Dip, Duck, Dive, and Dodge."
"If you can dodge a wrench, you can dodge a ball."
|
|
|
|
|
I need the web page to create multi ActiveX control dynamically,how can i do?
Later buggers harm more.
|
|
|
|
|
So I want to have my own modified button class in order to store variables. However, every time I add an array of the buttons, it causes my program to stop responding to keyboard input. Here's the custom Button Class:
public ref class buttonStoleMyInput: System::Windows::Forms::Button
{
void ButtonClick(System::Object^ /*sender*/,System::EventArgs^ /*e*/)
{
this->Toggle ^= true;
}
};
Then, I have a function to initialize an array of 10 buttons. It's called inside the constructor of the main form, and declared further down in the header file. The 10 buttons are stored in a static array.
public ref class Form1 : public System::Windows::Forms::Form
{
static array<buttonstolemyinput^>^ buttons
= gcnew array<buttonstolemyinput^>(10);
public:
Form1(void)
{
InitializeComponent();
AddCustomButtons();
}
//Windows Form Designer Code Follows
//until my AddCustomButtons() function:
private: void AddCustomButtons(void)
{
for(int i = 0; i < 10; i++)
{
buttons[i] = gcnew buttonStoleMyInput(i,0,(i*20));
buttons[i]->Click+= gcnew EventHandler(buttons[i], &buttonStoleMyInput::ButtonClick);
}
this->Controls->AddRange(buttons);
}
Additionally, I have a handler for keyboard input:
private: System::Void Form1_KeyPress(Object^, KeyPressEventArgs^)
{
MessageBox::Show("Keypress Detected");
}
If I uncomment the "AddCustomButtons" function from the Constructor, the program recognizes keyboard input again. If I uncomment it, the program spawns the buttons (and they work), but stops responding to keypresses.
Anyone have any idea whats going on?
|
|
|
|
|
You're posting in the wrong forum. Use the (Managed) C++/CLI[^] forum.
My first thought would be to not use an EventHandler at all. Have you tried overriding OnClick() in buttonStoleMyInput instead?
|
|
|
|
|
Is there a limit on the number of dialog items that can be put on a dialog in a single dialog application? How many edit boxes, buttons, etc?
|
|
|
|
|
I don't think there is a maximum. I would imagine the maximum would be dependent on the screen resolution and how badly you want to overwhelm the user
"Any sort of work in VB6 is bound to provide several WTF moments." - Christian Graus
|
|
|
|
|
I think the RC file format has a limit of 255 controls. The actual window system has a limit of 10000 USER handles per process.
|
|
|
|
|
Please post a pic of your dialog with 10000 controls on it!
Mark Salsbery
Microsoft MVP - Visual C++
"Remember the five Ds of dogeball: Dodge, Dip, Duck, Dive, and Dodge."
"If you can dodge a wrench, you can dodge a ball."
|
|
|
|
|
I think yes some times ago I add some controls on the forum but then compiler shows a message that you cant insert controls to forum.
|
|
|
|
|
BLENDFUNCTION blendFunc = {AC_SRC_OVER, 0, 110, 0};
m_maska.GetWindowDC()->AlphaBlend(0, 0,GetSystemMetrics(SM_CXFULLSCREEN),GetSystemMetrics(SM_CYFULLSCREEN),m_maska.GetWindowDC(), 0, 0,GetSystemMetrics(SM_CXFULLSCREEN),GetSystemMetrics(SM_CYFULLSCREEN),blendFunc);
where m_maska is a picture control variable an i wanna alphablend the picture control
whats wrong with that function ?
i used in in OnInit.. and the picturesize is full screen
|
|
|
|
|
cruonit wrote: i used in in OnInit..
Used in OnInit what? OnInitDialog?
That's called before a dialog is displayed so drawing there is useless.
You're also using a DC for the picture control as the source DC and the destination DC.
Why are you using icon sizes if something "is full screen"
What are you trying to do?
Mark
Mark Salsbery
Microsoft MVP - Visual C++
"Thanks,I overlooked the docs."
|
|
|
|
|
i tried it in OnPaint but nothing. The Icon size works for me as full screen :S:S i don't know why but it gives me the full resolution. I have fixed it now (in the post SM_CXFULLSCREEN).
You're also using a DC for the picture control as the source DC and the destination DC.
The source is the picture control(m_mask) and the destination for alphablend... or ?
|
|
|
|
|
cruonit wrote: The source is the picture control(m_mask) and the destination for alphablend... or ?
What are you wanting to do?
Your code is drawing the pixel contents of the control on top of itself.
Even if you do it at a good place in the code you're not going to see any difference.
Mark
Mark Salsbery
Microsoft MVP - Visual C++
"Remember the five Ds of dogeball: Dodge, Dip, Duck, Dive, and Dodge."
"If you can dodge a wrench, you can dodge a ball."
|
|
|
|
|
sto the destination patametar must be the dialog ?
|
|
|
|
|
I don't know - I keep asking what you want to do and you don't answer
If you're just drawing a bitmap using transparency and/or alpha values then you can derive a class
from CStatic.
In your custom CStatic class, add a handler for WM_ERASEBKGND which does nothing except return
TRUE.
Add a handler for WM_PAINT which uses AlphaBlend() to draw the bitmap to the control's window.
The destination DC will be a window DC like you're doing. The source DC needs to be a memory DC
with the bitmap selected into it.
I hope this is what you're looking for
Mark
Mark Salsbery
Microsoft MVP - Visual C++
"Remember the five Ds of dogeball: Dodge, Dip, Duck, Dive, and Dodge."
"If you can dodge a wrench, you can dodge a ball."
|
|
|
|
|
|
Hi,
I want to know how to invalidate (close) all open file handles for a particular drive,
opened by any process. How can I do it? I had read about this in MSDN or on internet
few months ago, but don't remember how to do it.
Please help me out.
|
|
|
|
|
There is an application called 'TaskManager Extension' which is opensource article downloadable from CodeProject. You may like to check out this since it is able to find all the handles of the process. It is most likely that you would be able to implement the same trick in your application also.
|
|
|
|
|
Hello All
Is there a way to do disk partitioning functions using C/C++.. such as resize a partition, create a new one etc.. I dont care how long and complicated it is! :p
Thanks for your help!
--PerspX
"Nowadays, security guys break the Mac every single day. Every single day, they come out with a total exploit, your machine can be taken over totally. I dare anybody to do that once a month on the Windows machine." - Bill Gates
|
|
|
|
|
If I wanted to do that I'd probably hit Google for the Gnome Partition Editor and see if the source is downloadable anywhere. It's the business when it comes to playing roulette with partition tables and it's free
Nothing is exactly what it seems but everything with seems can be unpicked.
|
|
|
|
|
Thank you, Matthew I will look at that (y)
--PerspX
"Nowadays, security guys break the Mac every single day. Every single day, they come out with a total exploit, your machine can be taken over totally. I dare anybody to do that once a month on the Windows machine." - Bill Gates
|
|
|
|
|
Hi,
I have a project I'm working on using GLUT, openGL and a few libraries. Now I'm trying to add sockets to it and whenever I include winsock2.h (haven't even written any relevant code) syntax error : ',' at some line which is meaningless appears. The code compiles and runs if I don't include winsock2.h
I'm using VC++ 2005. I have ws2_32.lib set up to link. I'm not including windows.h, MFC support. I just can't figure out what's wrong. Example code for winsock compiles and works.
As an aside can anyone point to a cross platform sockets library? I think GTK has one but it's way too big.
|
|
|
|
|
Found the problem, I called one of my variables "far" which turns out to be #defined somewhere
Still open to suggestions on portable socket library. I just don't want to mess around with it.
|
|
|
|
|
I expect you probably need to include windows.h before winsock2.h.
If you're looking for a cross platform sockets library I'd start with BSD sockets, probably in netBSD these days. It's where Microsoft started when they needed to 'source' a socket implementation for Win95 or so the rumour goes.
Nothing is exactly what it seems but everything with seems can be unpicked.
|
|
|
|