|
|
Hi everyone . I try to use SetWindowLongPtr function to change behaviour of CComboBox control , but I get an error :
error C2065: 'SetWindowLongPtr' : undeclared identifier
what I can do ? I read somewhere that I need to install SDK , it's really necesary ? I mention that I use VC6 .
|
|
|
|
|
I think you will find that <a href="http://msdn.microsoft.com/en-us/library/ms633591(VS.85).aspx">SetWindowLong()</a>[<a href="http://msdn.microsoft.com/en-us/library/ms633591(VS.85).aspx" target="_blank" title="New Window">^</a>] should do what you want.
I must get a clever new signature for 2011.
|
|
|
|
|
I'd agree, although it's worth to mention that it's not supported for 64-bit versions of Windows.
After a bit of googling I found this[^] forum post, which seems to solve the problem.
Sadly, the download link to the feb 2003 platform SDK is broken, but maybe you can get it from somewhere else (I haven't tried).
modified 13-Sep-18 21:01pm.
|
|
|
|
|
Thaddeus Jones wrote: it's not supported for 64-bit versions of Windows.
Something which is clearly explained if one reads through the documentation for both functions.
I must get a clever new signature for 2011.
|
|
|
|
|
mesajflaviu wrote: what I can do ?
Are you including the correct header file?
mesajflaviu wrote: I read somewhere that I need to install SDK , it's really necesary ?
Not for SetWindowsLong() , but it is highly recommended.
"One man's wage rise is another man's price increase." - Harold Wilson
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
"Man who follows car will be exhausted." - Confucius
|
|
|
|
|
Actually it is indeed required to install the SDK in the case of Visual Studio 6, since it predates 64-bit versions of Windows and doesn't have SetWindowLongPtr without the SDK.
modified 13-Sep-18 21:01pm.
|
|
|
|
|
I try
#include <Windows.h>
but didn't work.
|
|
|
|
|
Application A was using C.dll as an interface for camera. C.dll was and is erroneous. Sometimes it throws exceptions and causes the application to crash. Since the application is intended to be running always in the platform and is responsible for many things as well as handling cameras, we decided to use in indirect method for the application to use the camera. The plan was to separate the dll from the application. Another application got responsible for getting involved with sending the appropriate commands to the camera via the dll and in another side be in communication with the application. We call it server. The application is now a client for it. The communication between these two separate processes is established via a named pipe. I've tested this link and it works fine.
Now the problem is that after starting the camera I use the following code to capture an image:
bool CCamera::CaptureImage(LPCSTR i_lpszBMPFileName)
{
if (m_hWnd &&
capGrabFrameNoStop(m_hWnd) &&
capFileSaveDIB(m_hWnd, i_lpszBMPFileName))
return true;
return false;
}
The m_hWnd is created with this code:
m_hWnd = capCreateCaptureWindow(m_sName, WS_CHILD|WS_CLIPSIBLINGS, 0, 0, 160, 120, i_hwndParnt, 0xffff);
i_hwndParent in both cases (before separating the application and after it) is obtained with the following code:
i_hwndParent = CreateWindow("STATIC", "parent", WS_POPUP, 0, 0, 20, 10, NULL, NULL, NULL, NULL);
Before changing the method to a client/server method, in CaptureImage everything was working fine. Both capxxx macros did their job and returned with true or false. But now, the program control remains inside them and the if statement is not evaluated until I stop the camera. After stopping the camera these macros return with true. It causes the application to remain in the CaptureImage function and never returns until the camera is stopped. I wondered what might be different in two methods. I couldn't realize why the macros don't return.
Any idea?
Thx
|
|
|
|
|
This is really for those Visual C++ 6.0 programmers out there.
I have a workspace which builds 3 apps & dozen of DLLs. Each project has it's own resources (resource.h & corresponding RC file).
I like to merge the resources of the 3 main apps into one. I notice the 3 apps share some common strings. However, due to 10-20 years of development, the defined constants that have same name may not have same number.
App1 resource.h
#define IDS_STRING1 82
App2 resource.h
#define IDS_STRING1 79
App3 resource.h
#define IDS_STRING1 83
Am wondering if there's a tool out there that can clean up multiple resources... to make final/eventual merging easier.
Problems lie when it's a common define constant, but the string literal are actually different.
So maybe should have a batch routine to index/map by the string literal first, then ensure the define constant matches, if not then flag it.
My resource.h files are huge, millions of lines... hence why am wondering if there exists a resource.h cleaner.
|
|
|
|
|
|
Why would you want to combine resources? I find it easier and cleaner to have the separation...
|
|
|
|
|
Hi Experts,
How to write a plugin(firefox) for an activex control. please give me some clues regarding this. I have searched many times but didn't got a proper way...
Regards,
Spk521
|
|
|
|
|
|
hi,
i did not got your answer.
My question is that suppose my screen resolution is 1024x768 and i have designed my GUI as per the current resolution.
by using following code i can get my systems current resolution
private: System::Void button1_Click(System::Object^ sender, System::EventArgs^ e)
{
MessageBox::Show("Screen Resolution is : " +monitor_width +" x " + monitor_height, "Dnyan", MessageBoxButtons::OK, MessageBoxIcon::Information);
double xRatio = monitor_height / 800.00;
double yRatio = monitor_width / 600.00;
}
public: System::Void Form1_Load(System::Object^ sender, System::EventArgs^ e)
{
monitor_height=Screen::PrimaryScreen->Bounds.Height;
monitor_width=Screen::PrimaryScreen->Bounds.Width;
}
Now suppose my project is in network and one persons system resolution is 800x600 second person screen resolution is 1024x768 and others is different
in this case i want to adjust control default location as well as its size as per screen resolution
then please tel me how its possible in C++ with Windows platform (in .net IDE)
Please help me
|
|
|
|
|
Please re-post your question in appropriate forum.
I believe in LOVE AT FIRST SIGHT...
Bcoz I have loved my Mother...
even since I opened my eyes...(ICAN)
|
|
|
|
|
This question has already been responded to here[^]. Please do not start a new thread for an existing question.
I must get a clever new signature for 2011.
|
|
|
|
|
I had the same problem. You design your GUI for the lowest resolution (as someone already suggested), then when you're at a higher resolution, you have extra space in the X and Y directions. You then write functions to 1) space the controls (vertically and horizontally) using this extra space, and 2) enlarge the controls with the extra space.
Not all controls will use extra space, e.g. buttons will remain the same size. But list boxes can use the extra space to show more data.
You can write one class that does all this, then call it with each of your forms, the extra X and Y space, and resizing information.
For the resizing information, I defined a language called WASP (Window Arrangement Specification Protocol) with statements consisting of ints. The first int is the operation (e.g. space in X direction, add N percent of the X extra apace to the following controls, etc).
I did this in MFC, and each control was referred to by its int ID. Sizes and percents were also ints. Since a WASP program is all ints, I could define it as a static array of ints in my program. The advantage to this is that I didn't have to deal with any parsing or lexical analysis; I just passed the int-array WASP program to the WASP class. I used #defines for the int operations for readability.
There's a separate WASP program for each form you want to resize. The WASP program is run once when your form is initialized.
|
|
|
|
|
Sounds interesting. Why don't you post an article about WASP?
|
|
|
|
|
That's a good idea. I might do it when I have the time.
|
|
|
|
|
I think there would be a lot of interest in it. Several of my clients have asked me about doing this.
|
|
|
|
|
Hello,
Our software has a credential provider (dll) which is displaying a DHTML dialog with several input boxes during logon time on Windows 7 Korean OS. It is required to enter Korean characters when the user sets the focus on the input box. However, the moment user clicks on the input box on the dialog, the keyboard option that gets displayed to enter Korean characters vanishes. Can you please tell us how is it possible to make the DHTML dialog’s input boxes accept non-english characters? The input boxes are standard type and not “password”.
Thank you.
WIth regards,
Shashikant
|
|
|
|
|
This question does not appear to have anything to do with C++. I would suggest re-posting in a more appropriate forum.
I must get a clever new signature for 2011.
|
|
|
|
|
Thank you.
Please let me know the forum where I can post this question.
Actually we tried to set system / thread locale to Korean programatically (Using MFC only) using SetThreadLocale() and SetThreadUILanguage() to Korean. But Failed. I thought there meight be something in MFC where we can set this option.
With regards,
Shashikant
|
|
|
|
|
Shashi.Shinde wrote: Please let me know the forum where I can post this question.
Well I'm not sure any more; your original question mentioned DHTML so I assumed that was the issue you were having problems with.
I must get a clever new signature for 2011.
|
|
|
|