|
Hello,
I have a problem ... I want to capture the desktop and save it in a 24Bit bitmap ... my desktop can be 256, 16bit or 32bit color.
How can I do that ? It works fine if the desktop is in 24bit ... but I want to convert a HBITMAP from 256, 16bit, 32bit to 24bit ... I hope I will not have to convert it manualy by saveing it byte by byte .... I hope there is something in windows that can take care of it ... because I saw 15Bit color and God knows many these types can be and I hope I don't have to take care of all... Please if anone can help me... !!! thanks !!!
|
|
|
|
|
|
it's cool .... !
thanks .... !!!
|
|
|
|
|
Hi
Recently I installed Visual Studio .NET for testing purposes, but kept Visual Studio 6 on my HDD. Now I uninstalled VS .NET and VS6 doesn't handle files like .dsw,.cpp,.h etc anymore. How do I restore the file associations with VC6 again?
regards
modified 12-Sep-18 21:01pm.
|
|
|
|
|
Either reinstall, or set the associations manually. VS6 doesn't include any tools for redoing the associations.
Ryan
Being little and getting pushed around by big guys all my life I guess I compensate by pushing electrons and holes around. What a bully I am, but I do enjoy making subatomic particles hop at my bidding - Roger Wright (2nd April 2003, The Lounge)
Punctuality is only a virtue for those who aren't smart enough to think of good excuses for being late - John Nichol "Point Of Impact"
|
|
|
|
|
Ok thanks, seem like it's gonna be a lot of work. Do I lose my VC settings like colors, fonts, include/lib folders etc. if I reinstall?
modified 12-Sep-18 21:01pm.
|
|
|
|
|
Greg S. wrote:
Do I lose my VC settings like colors, fonts, include/lib folders etc. if I reinstall?
Yeah, but you can backup that part of the registry first (just export to a .reg file, and import again after the install)
Ryan
Being little and getting pushed around by big guys all my life I guess I compensate by pushing electrons and holes around. What a bully I am, but I do enjoy making subatomic particles hop at my bidding - Roger Wright (2nd April 2003, The Lounge)
Punctuality is only a virtue for those who aren't smart enough to think of good excuses for being late - John Nichol "Point Of Impact"
|
|
|
|
|
Anybody know how to use the Marshal.GetObjectsForNativeVariants function.I want to transfer the data from Unmanaged Win32 DLL to C# DLL.but the restriction is that I can only use IntPtr as passing param.
Like
Win32 DLL
I created One SafeArray
SAFEARRAY *pSA;
//Some code
pSA = SafeArrayCreate(VT_BSTR...);
SafeArrayPutElement(pSA...,String here );//safearray is full of BSTR Strings
then I called the C# DLL function
pData->ISetIntData((long)pSA);
And in C# DLL
public void ISetIntData(IntPtr Val)
{
Object[] MyObj=Marshal.GetObjectsForNativeVariants(Val,2);
String str=(String)MyObj[0];
MessageBox.Show(str);
//Here It is crashing...
}
Is this a right way Or I am doing some crazy Stuff?
Vikram
Vikram
|
|
|
|
|
I created a class with serialzation support. But then I store class all Ok, but then I try to load class compilation don't pass. Copliler writes:
binary '>>' : no operator defined which takes a right-hand operand of type 'class SnytVolRelOrder *' (or there is no acceptable conversion);
Maybe anyboby knows that's the problem is ?
Sorry for my English.
|
|
|
|
|
You can't serialize this type. Only following types works:
CObject* | SIZE und CSize |float
----------------------------------------
WORD | CString | POINT und CPoint
DWORD | BYTE | RECT und CRect
double | LONG | CTime und CTimeSpan
int | COleCurrency | COleVariant
COleDateTime | COleDateTimeSpan
You must override Serialize for each class that you intend to serialize. The overridden Serialize must first call the Serialize function of its base class.
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vclib/html/_mfc_cobject.3a3a.serialize.asp
|
|
|
|
|
I've already done this. The problem is my class normaly loads but then i try to story compliter write an error.
SnytVolRelOrd ord; or SnytVolRelOrd *ord = new SnytVolRelOrd();
CArchive ar(...);
....
ar<<ord; <-----------ok.="" compiler="" passed="" this="" place
ar="">>ord;<------Comiler write an error.
Life is not a programm.
|
|
|
|
|
I have no idea, which kind of problem it is. But, if I serialize my own classes i call the serialize() Function. Like this in DocClass:
void CEmvDoc::Serialize(CArchive& ar)
{
if (ar.IsStoring())
{ // Save
m_tProjDate=CTime::GetCurrentTime();
ar << m_sProjName << m_tProjDate;
}
else
{ // Load
ar >> m_sProjName >> m_tProjDate;
}
m_oaInterfaces.Serialize(ar);
SetModifiedFlag(false);
}
|
|
|
|
|
May be i didn't say some details. A use CArchive with CSocketFile. I create
two CArchive arIn and arOut(before i create CSocket,CSocketFile ) and if y want to send data to i will write arOut<<..
and the i want to get data i write arIn>>.. and in this place error occures.
Sorry tor my English
|
|
|
|
|
Hi
I had a line like this:
<br />
#if defined _CIP || (_STANDALONE && (_KA || _UDV)) || _OTN9<br />
<include something><br />
#endif<br />
One of these defines are no longer needed so I changed it into:
<br />
#if defined (_STANDALONE && (_KA || _UDV)) || _OTN9<br />
<include something><br />
#endif<br />
But this gives a warning / error
aaa.cpp(288) : warning C4004: incorrect construction after 'defined'
aaa.cpp(288) : fatal error C1012: unmatched parenthesis : missing '('
But I'm beginning to suspect it should have been
<br />
#if (defined _STANDALONE && (defined _KA || defined _UDV)) || defined _OTN9<br />
instead
This gives no compiler warnings / errors
What I want is to include some lines if one of the following combination are true
_STANDALONE && _KA
_STANDALONE && _UDV
_OTN9
Would this changes how things would be handled in the preprocessor stage ?
Remark:
I don't use #define to define these, but using "preproccesor settings" under "project settings" , that is the /D switch
Using VC6
|
|
|
|
|
to_be_unknown wrote:
#if (defined _STANDALONE && (defined _KA || defined _UDV)) || defined _OTN9
This is the correct syntax, and will work as you require. The original syntax that you used would work, but only if the defines had the value 0 or 1, or if they were not defined (the preprocessor assumes a definition to have the value 0 if it is not defined). If they had any other value, it would not work correctly.
The reason you were getting compiler errors was because the defined operator operates on an identifier, not on an expression.
Ryan
Being little and getting pushed around by big guys all my life I guess I compensate by pushing electrons and holes around. What a bully I am, but I do enjoy making subatomic particles hop at my bidding - Roger Wright (2nd April 2003, The Lounge)
Punctuality is only a virtue for those who aren't smart enough to think of good excuses for being late - John Nichol "Point Of Impact"
|
|
|
|
|
Thanks
It would mean I'm going to change alot of like this in my program.
Relying on the preprocessor to assign 0 to not-defined defines could be dangerous. Unless it is specified so in some ANSI/ISO standard ?
|
|
|
|
|
to_be_unknown wrote:
Relying on the preprocessor to assign 0 to not-defined defines could be dangerous.
Absolutely. I'm not sure if it's in the standard or not.
Ryan
Being little and getting pushed around by big guys all my life I guess I compensate by pushing electrons and holes around. What a bully I am, but I do enjoy making subatomic particles hop at my bidding - Roger Wright (2nd April 2003, The Lounge)
Punctuality is only a virtue for those who aren't smart enough to think of good excuses for being late - John Nichol "Point Of Impact"
|
|
|
|
|
Hi
im having problems retreiving the values held in my combo box
the combobox holds a list of strings
i have
CComboBox* pLB = (CComboBox*) GetDlgItem(IDC_CNOCALLS);
int nIndex = pLB->GetCurSel();
DWORD n = pLB->GetItemData( nIndex);
however im getting a error on DWORD, and its not giving me the value in the combo box
can ne1 help
thanks
simon
|
|
|
|
|
If you want the value of a specific item you need the GetText()-function. Try this:
<br />
CString strText;<br />
pLB->GetText(nIndex, strText);<br />
strText will then hold the value of the item at position nIndex. If you need an interger (if your combobox holds numbers() just do int number = atoi(strText); .
regards
modified 12-Sep-18 21:01pm.
|
|
|
|
|
Try to Use
GetLBTextLen
GetLBText
GetItemData is a different function..check out MSDN.
|
|
|
|
|
Hi..All
i am using a Bitmap in a CBrush to display the pattern in a rectangular box at many places in the drawing of my vc++ application..
the problem is that on certain plotters the pattern is not displayed at all
although it is coming and very good in normal view and print preview.
and on some plotters it just display the crosses all over the rectangle.
and some time the pattern is displayed but it is so close that whole rectangle color becomes black...
Does any body have any idea why...
That would be very nice of him.
Thanks
Muhammad Kamran
Sofware Engineer.
|
|
|
|
|
Some vector based devices do not support that kind of drawing. Try calling GetDeviceCaps(DT_PLOTTER) when in print mode, and if it is true, don't draw using the brush. Typically, vector devices don't support the more advanced printing, like raster devices.
onwards and upwards...
|
|
|
|
|
Hi,
I am planning to develop a tool. It needs to work on a folder of size 2 GB. First it needs to remove the read only attribute for all the files in the folder. Then a third party tool will do some more processing and then my tools needs to delete all the files. This tools needs to work on Win2K. Presently i am using attrib and del dos commands. it takes hell lot of time to dothis task. I would like to develop something at the NTFS level to do this. Any pointers, samples will be of alot of help.
Regards,
Cutti
|
|
|
|
|
Unless I've misunderstood, couldn't you just use the Win32 API or MFC to change file attributes and delete files? CFile provides methods GetStatus() , SetStatus() and Remove() that may fit the bill.
/ravi
Let's put "civil" back in "civilization"
Home | Articles | Freeware | Music
ravib@ravib.com
|
|
|
|
|
Yes, something like:
void SetFilesToNotReadonly(LPCSTR cpFileDir)
{
CString cFileName;
WIN32_FIND_DATA sFD;
CString cFileSpec = CString(cpFileDir) + CString("*.*");
HANDLE hFind = FindFirstFile((LPCSTR)cFileSpec,&sFD);
if (hFind != INVALID_HANDLE_VALUE)
{
if (!(sFD.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY))
{
cFileName = CString(cpFileDir) + sFD.cFileName;
SetFileAttributes(cFileName, sFF.dwFileAttributes & (~FILE_ATTRIBUTE_READONLY));
}
while (FindNextFile(hFind,&sFD))
{
if (!(sFD.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY))
{
cFileName = CString(cpFileDir) + sFD.cFileName;
SetFileAttributes(cFileName, sFF.dwFileAttributes & (~FILE_ATTRIBUTE_READONLY));
}
}
FindClose(hFind);
}
}
onwards and upwards...
|
|
|
|