|
Maybe you have different resolution in defferent windows so it looks like that in XP.
Mazy
No sig. available now.
|
|
|
|
|
Same resolution in both SO. It's an amazing bug.
Doc
|
|
|
|
|
In fact I need to adapt some piece of code whether the application is running on Win2k+ or Win9x.
Thanks for your help
-MyttO
|
|
|
|
|
GetVersionEx()
Mazy
No sig. available now.
|
|
|
|
|
|
I found this true!
//------------------------------------------------------------------------
CString GetWinVersion()
{
CString Ver;
OSVERSIONINFO osinfo;
osinfo.dwOSVersionInfoSize = sizeof(OSVERSIONINFO);
GetVersionEx(&osinfo);
Ver.Format("Windows Version %1d.%1d", osinfo.dwMajorVersion, osinfo.dwMinorVersion);
return Ver;
}
//------------------------------------------------------------------------
I'll TRY my best
|
|
|
|
|
Thank you all for fast answers!!
-MyttO
|
|
|
|
|
Hi,
I would like to know how to make a copy of the file that i just opened.
what is the sytax for it????
Ehsan Behboudi
|
|
|
|
|
Look for CopyFileEx() in MSDN:
Mazy
No sig. available now.
|
|
|
|
|
What's the best way to go about "learning" the machines that are connected to a network? (as part of a LAN Workgroup, domain, etc.)
Let's say for instance that I have an app that can remotely connect to other machines to provide monitoring functionality. It would be nice to have a dynamic list of available machines that it could connect to. What all is involved here? I'm not sure if I need to look into SNMP or if just TCP/IP stuff will do the trick. Or maybe there are Windows API functions that handle all this?
[EDIT] Not sure if it matters, but I'm only interested in how to do this on Windows NT/2000/XP/2003 (not 95/98/ME). [/EDIT]
Thanks!
--
Edward Livingston
(aka ExtraLean)
--
"I still maintain that seeing a nipple is far less disturbing than seeing someone get their brains blown out." -- Chris Maunder
|
|
|
|
|
Does WNetOpenEnum()/WNetEnumResource() help?
A rich person is not the one who has the most, but the one that needs the least.
|
|
|
|
|
Yes! Thank you David.
--
Edward Livingston
(aka ExtraLean)
--
"I still maintain that seeing a nipple is far less disturbing than seeing someone get their brains blown out." -- Chris Maunder
|
|
|
|
|
Hi all,
I would like to know how to insert a CDateTimeCtrl (DateTimePicker) into my ToolBar.
I use this way :
BOOL CMyToolBar::CreateDTPicker(CDateTimeCtrl& dtPicker, UINT nIndex, UINT nID, int nWidth)
{
// Create the DateTimePicker Control :
SetButtonInfo(nIndex, nID, TBBS_SEPARATOR, nWidth);
CRect rect;
GetItemRect(nIndex, &rect);
if (!dtPicker.Create(DTS_RIGHTALIGN | DTS_UPDOWN | WS_TABSTOP, rect, this, nID))
{
TRACE("Failed to create DateTimePicker Control\n");
return FALSE;
}
return TRUE;
}
taken from : http://www.codeproject.com/docking/ToolbarWithCombo.asp
but it doesn't work for the CDateTimeCtrl, the control doesn't appear.
Can someone help me ?
Thanks in advance,
Phil
|
|
|
|
|
hmmmmmmmmmmm, sh*t, I just forgot the WS_VISIBLE in the Create function !!!
So it works now.
BrutalDeath0
|
|
|
|
|
My application draws complex shapes to the screen that consist of a mixture of straight lines and polybezier curves. The shapes are filled by defining a Path and creating a CRgn object, within a CreateRegion() function. The Draw function for the object first paints the fill and then draws the outline. This works just fine for output to the screen, but when I use Print Preview and sometimes print the display I get a mismatch between the shapes outline and fill. I've found the MSDN article on how to convert the screen coordinates to CPreviewDC coordinates (http://support.microsoft.com/default.aspx?scid=http://support.microsoft.com:80/support/kb/articles/q128/3/34.asp&NoWebContent=1) but this only deals with rectangular shaped clip regions. Anyone got any points? Code can be included if you need to take a look
___________________________
Jeremy Preston
|
|
|
|
|
Try this article.
http://www.codeproject.com/printing/ClipRegionProblem.asp
I think it may help you.
You should also consider that some printer DCs only support one clipping region at one time. So setting multiple clipping regions may not work when printing!
|
|
|
|
|
Thanks CodeBrain....I'd found this article too. But it's still only dealling with rectangular shaped regions. I have regions that are a mixture of straight lines and bezier curves that are defined via Paths, and used to fill these shapes. When in Print Preview / Printing I need to offset and scale this region so that the fill is in the same location as the outlines. The big problem are the bezier curves and how to offset them....I'm really stuck!!
___________________________
Jeremy Preston
|
|
|
|
|
Unfortunatly I am not a clipping path expert.
Maybe the problem is your printer which does not support complex regions. But I am not sure... You may check the caps. of your printer using GetDeviceCaps. But I don't know if GetDeviceCaps returns this information. What I know is that some printer do support only ONE clipping region. So that may be your problem, too.
So if you have the problem in print and preview it may be a printer problem.
You can try to paint your output in a memory DC (compatible to the screen DC) with a DIB first and then use StretchDIBits to copy the whole thing to your printer DC in OnPrint. I have very bad experiences when doing the output directly to the printer DC...
Sorry that I can't help you more...
|
|
|
|
|
Thanks for your efforts CodeBrain....it really is an annoying problem. I came up with an idea last night walking home from work, so I'll try that today and see how I get on. If it works I'll let you know what I did!!;)
|
|
|
|
|
I have a Dialog based Vc++ application from where i added some class(Dialog classes) to the gallery .
I began work on a new MFC wizard created Dialog App and added the components from the gallery (.ogx) . When i try to compile i am getting compilation errors about the ID's of controls(resources) that were imported from the gallery .
Errors look like this
: error C2065: 'IDD_EEPROM' : undeclared identifier<br />
: error C2057: expected constant expression<br />
: error C2065: 'IDC_WKSAFE' : undeclared identifier<br />
Doesnt seem to like this !!!
enum { IDD = IDD_EEPROM };<br />
CMSFlexGrid m_grid1;<br />
What do i need to modify to get it compiled . I even deleted the .clw files and built it again and it reflects the imported class and all these resources
|
|
|
|
|
When you save a class into the Gallery, it's implementation and header files (.cpp and .h) are stored away. In the case of a dialog class, it also requires a dialog resource (IDD_EEPROM) to exist in your resource script. Apparently, your dialog resource didn't get saved with the other files.
Like the error code states, the IDD_EEPROM identifier is unknown: check your resource script of what the ID of the dialog is there, and replace the identifier with the correct one.
Additionally, the resource identifiers are not saved with the class. This means that if your dialog class has DDX routines implemented, then those WILL cause the same error. To fix this, you must manually rename the identifiers in DoDataExchange function of your dialog class.
-Antti Keskinen
----------------------------------------------
The definition of impossible is strictly dependant
on what we think is possible.
|
|
|
|
|
Hello out there,
i have the following problem :
I am using an Active X Image Library (Leadtools), but the methods to read pixel values are much too slow for my purpose.
For example, to read an array of 1000x1000 pixels by the function
long colour = m_Lead.GetPixel(x,y) takes almost 40 seconds. I would net a way to do it in 1 sec or less.
But, the libray allows to copy an image into a DIB very fast (less than a sec for the 1000x1000 image).
The example provided looks like this, where m_Lead1 and m_Lead2 are the image variables associated with the active X control
int MyFlags = COPY_EMPTY + COPY_DIB + COPY_PALETTE;
m_Lead1.Copy(MyFlags);
m_Lead2.Paste(0);
m_Lead2.Reverse();
OLE_HANDLE MyDib = m_Lead2.GetDIB();
m_Lead1.SetDIB(MyDib);
m_Lead1.ForceRepaint();
GlobalFree((HGLOBAL) MyDib);
My question is now, how can I read pixel color intensities from this DIB or OLE HANDLE ? My understanding of Windows bitmap handling is very limited, so a few lines of sample code would be very helpful.
Thank you very much,
ch
|
|
|
|
|
Go here CDibData and look at the functions SetPixel, SetValue, GetPixel, and GetValue.
You can also get a copy of Programming Windows by Charles Petzold, which has a section on DIBs.
INTP
|
|
|
|
|
Has anyone used this successfully? I need to do something so simple it's pathetic, but I haven't figured out HOW... Here's what I want to do:
I'd like to have a webpage that loads my dll (it's in a cab and all that)... And it's being called like this:
<object classid="clsid:XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX" codebase="XXXXXX.CAB">
<param name="text" value="Yo man!">
</object>
So here's the deal... All I want said application to do... Is to be able to get that text from the param tag!!! Any hints/code snippets in the right direction? I've been having a bugger of a time, and Microsoft's help pages are of NO help for a newb like me!
I know it's probably something easy, but I can't get it to work! Thanks in advance!
|
|
|
|
|
Hi,
I have a simple problem with virtual functions and dlls.
See the sample:
class Test
{
public:
Test() { }
~Test() { }
virtual long GetCountRows() { return 1; }
};
class TestA : public Test
{
public:
TestA() { }
~TestA() { }
virtual long GetCountRows() { return 2; }
};
int main(int argc, char* argv[])
{
TestA testa;
long x = testa.GetCountRows();
Test* ptest = &testa;
x = ptest->GetCountRows();
return 0;
}
If this code is in the same area (same source file or lib), it works correct, I get always 2 with GetCountRows().
But if the base class is in a dll, I have problems, because with the second call of GetCountRows() I'll get 1.
Can someone help me?
Thanks...
Achim Mueller
|
|
|
|