|
i am one project where i have to transfer controls data between two dialog.
i can manage to send the data from ist dialog to second
like this...
CMyDialog2 m_mydlg2;
m_mydlg2.myvariable2=myvariable1;
m_mydialog2.DoModal();
this works correctly
but now i need to get the data of second dialog in first one
after closing the second dialog
can anyone help me for that
thax
|
|
|
|
|
CMyDialog2 m_mydlg2;
m_mydlg2.myvariable2=myvariable1;
int nRet = m_mydialog2.DoModal();
if(nRet == IDOK) // if okay was clicked get the data from the dialog
{
myvariable1 = m_mydialog2.myvariable2; // get the variable back out of the dialog
}
Michael
|
|
|
|
|
Use Michaels's suggestion, or pass a pointer to the second dialog, as in:
m_mydlg2.myptrvariable2 = &myvariable1; Now when myptrvariable2 is modified in the second dialog, the first dialog will automatically "see" the change(s).
"When I was born I was so surprised that I didn't talk for a year and a half." - Gracie Allen
|
|
|
|
|
How can a self-extracting file get parameter from html ?
Hi, guys:
I've developed a dll together with several other files and I want to put them onto my website so that anyone visits it will download a self-extracting file, when the download is finished all the files should be extracted into a system directory, say c:\winnt\system\foo, and the indicated main exe file will start automatically.
The problem is how can I get some parameters from the html page? The famous PackageForTheWeb can do most work for me but I still do not know anything about the parameters.
Thanks for your patience and any help is much appreciating.
TIA
|
|
|
|
|
What parameters? Post examples. In general, the client downloads the self-extracting file and then executes it.
Kuphryn
|
|
|
|
|
I know this is more of a WTL question, but I figured it could be answered here more quickly. If not then sorry for posting this here. I see many people with code using WTL that have docking windows (like VS.NET) and I wanted to know if WTL actually has a docking window class or if they've all simply been created from scratch.
If they are created from scratch does anyone know why everyone uses WTL to do it? I've never seen docking windows (like VS.NET) created with anything other than WTL.
Thanks in advance.
- monrobot13
|
|
|
|
|
unsigned char *px = new unsigned char[bm.bmHeight*bm.bmWidthBytes];
bitmap->GetBitmapBits(bm.bmHeight*bm.bmWidthBytes,px);
Please, tell me the color format of the px above.
Thank you,anyway!
Hello World!
|
|
|
|
|
Won't work. For starters, some formats have extra bytes of padding on the end of each scanline, so your size could be wrong.
However, if bmWidthBytes is accurate, then it's easy.
bmWidthByte value color format
1 paletised, could be 1, 4 or 8 bit
2 16 bit
3 24 bit
4 32 bit ( but the last 8 are ignored.
Christian
I have drunk the cool-aid and found it wan and bitter. - Chris Maunder
|
|
|
|
|
unsigned char *px = new unsigned char[bm.bmHeight*bm.bmWidthBytes];
bitmap->GetBitmapBits(bm.bmHeight*bm.bmWidthBytes,px);
i found px[2] is a red color BYTE.
whereas px[0] and px[1] is what color BYTE.
Thank you!
Hello World!
|
|
|
|
|
Windows generally stores 24 and 32 bit images as BGR, rather than RGB.
Christian
I have drunk the cool-aid and found it wan and bitter. - Chris Maunder
|
|
|
|
|
unsigned char *px = new unsigned char[bm.bmHeight*bm.bmWidthBytes];
bitmap->GetBitmapBits(bm.bmHeight*bm.bmWidthBytes,px);
if my image is 24 bit, the px array is stored as neither BGR nor RGB.
why so?
Thank you!
Hello World!
|
|
|
|
|
The only possible reaon I can think of is my first hunch - GetBitmapBits does not work. Actually, I think it does, only if your bitmap is a DIBSection.
Christian
I have drunk the cool-aid and found it wan and bitter. - Chris Maunder
|
|
|
|
|
Hello, everyone!
How to get network interface name of local machine? For example, the value of my machine is "NDIS 5.0 driver" and "MS TCP Loopback interface".
Thanks in advance,
Geo
|
|
|
|
|
use the GetAdaptersInfo API!
Don't try it, just do it!
|
|
|
|
|
Hello just respond to this and I'll send an E-mail to you with the source code attachment, yes this is done in visual c++ 6. Tic tac toe thing. Would need suggestions if any and help. would be forever in dept.
<marquee>Universal Project... Soon to be a .net
|
|
|
|
|
you can send this to kotbegemotus[at]rambler.ru
|
|
|
|
|
my e-mail is hisham86@aucegypt.edu
i have the same orblem but i have to solve it with trees
|
|
|
|
|
Does anyone know what kind of number generators are out there and what is your opinion on which is the best one, C++ console, not mfc or visual c++ 6. Thx.
<marquee>Universal Project... Soon to be a .net
|
|
|
|
|
|
It depends on how "random" you need your random numbers to be. The standard (ANSI C) rand() function should be random enough for most general-purpose applications, but on some platforms be aware that the lower-order bits may be much less random than the higher-order bits. AFAIK, most implementations of rand() use the "linear congruential formula":
http://www.taygeta.com/rwalks/node1.html[^]
Another random number generation algorithm is the Mersenne Twister:
http://www-personal.engin.umich.edu/~wagnerr/MersenneTwister.html[^]
Of course, the strongest random number generators are ones which use a random natural source rather than an algorithm. Under Linux, the /dev/random device collects entropy in the form of timings between hardware interrupts. The downside to these generators are the fact that you can quickly exhaust the supply of random bits from the source and thus have to wait while the device collects more data. Other potential natural sources of random bits are measurements of radioactive decay and even lava lamps (as implemented by a team at SGI, using the image data from a webcam pointed at the lamps).
For much more in-depth information about random number generation, see: "Numerical Recipes in C: The Art of Scientific Computing", particularly chapter 7 ("Random Numbers"). The authors go through a number of random number generation algorithms with varying randomness.
- Mike
|
|
|
|
|
Michael Imamura wrote:
Of course, the strongest random number generators are ones which use a random natural source rather than an algorithm.
On Windows, use CryptGenRandom . This uses the process ID, thread ID, milliseconds since boot, current local time, the high-precision performance counters accessed by QueryPerformanceCounter , a hash of the environment block, some of the processor's internal counter registers, and various of the system's running counters (things like bytes transferred per second, context switches per second). Information from Writing Secure Code, Second Edition (Michael Howard & David LeBlanc, MS Press).
|
|
|
|
|
I want to create a slider control by command. I have done following but it doesn't appears in the dialog
<br />
CSliderCtrl m_createslider;<br />
const RECT rc = {20,200,500,60};<br />
m_createslider.Create (WS_TABSTOP|WS_CHILD|WS_VISIBLE|TBS_AUTOTICKS |TBS_TOOLTIPS|TBS_RIGHT|TBS_BOTTOM , <br />
rc, this, IDC_MYSLIDER);<br />
m_createslider.ShowWindow(SW_SHOW);<br />
Please tell me why.
vhunghl
|
|
|
|
|
Where did you put this code?
If you put it in OnInitDialog(), the slider will be destroyed when you exit this function because m_createslider goes out of scope. Declare m_createslider as a member of your dialog class.
|
|
|
|
|
I have declared folowing
<br />
class CexplDlg : public CDialog<br />
{<br />
public:<br />
CexplDlg(CWnd* pParent = NULL);
<br />
enum { IDD = IDD_EXPL_DIALOG };<br />
<br />
protected:<br />
virtual void DoDataExchange(CDataExchange* pDX);
<br />
<br />
protected:<br />
HICON m_hIcon;<br />
<br />
virtual BOOL OnInitDialog();<br />
afx_msg void OnSysCommand(UINT nID, LPARAM lParam);<br />
afx_msg void OnPaint();<br />
afx_msg HCURSOR OnQueryDragIcon();<br />
DECLARE_MESSAGE_MAP()<br />
public:<br />
CSliderCtrl m_createslider; <br />
};<br />
|
|
|
|
|
I have called waveOutReset command and then waveOutClose command, but it doesn't happen MM_WOM_DONE event.
vhunghl
|
|
|
|