|
YES!!
|
|
|
|
|
|
Hi,
I have a dialog box in my ATL exe, I want to use/link a C Library. AFter clicking OK button on the dialog on of C functions should execute .
How to do this. linking the Clibrary and opening the C function.
Can I use the C code direct in ATL module ? how?
marcoslav
|
|
|
|
|
This is not the right forum to post the Question.
Appu..
"If you judge people, you have no time to love them."
|
|
|
|
|
noone answers there in ATL so posted here
|
|
|
|
|
As we know, when we want to shut our computer,
the system pop up a shuting window,
and the screen is locked, that the color lightness is gradually decreased , and the mouse click is invalid.
following is some codes to create this function, and I don't know why it be this way?
////////////////////////////////////////////////////////
byte pbit[16]=
{
0x55, 0, 0xaa, 0x0,
0x55, 0, 0xaa, 0x0,
0x55, 0, 0xaa, 0x0,
0x55, 0, 0xaa, 0x0,
};
HBITMAP hbm=CreateBitmap(8, 8, 1, 1, pbit);
HBRUSH hbr=CreatePatternBrush(hbm);
HDC pdc=::GetDC(0);
SelectObject(pdc, hbr);
PatBlt(pdc, 0, 0,
GetSystemMetrics(SM_CXSCREEN),
GetSystemMetrics(SM_CYSCREEN),
0xa000c9 //BLACKNESS//DSTINVERT//PATINVERT
);
DeleteObject(hbm);
::ReleaseDC(0, pdc);
//end
1.When I move the window (this cwnd) the screen changed, but the WINDOWSXP doesn't do it , how I do it , on the other hand , how to mask the message that not sent to the current shuting CWnd?
2.Byte Array pBit , what its function?And what 0xa000c9 is ?
If you had some good codes about this , please give me for some references, thank you!
Online waiting for answers!
Just my interest for these common things
|
|
|
|
|
|
ok, thank you very much!
that's what I want!
Just my interest for these common things
|
|
|
|
|
I'm working on an app that needs to work with both ascii and unicode, but I seem to have run into a rather frustrating problem.
It seems that for some reason, whenever I pass a unicode string to COleVariant.SetString(), the bstrVal only contains the unicode string up to the first NULL character in the string(regardless of the VARTYPE parameter). Hence most of the unicode strings are prematurely truncated. If I remember my unicode correctly it requires a double NULL to indicate the end of a unicode string does it not?
Anybody know of why this may be and how I can fix it?
When I die I'd like to go peacefully in my sleep like my father, not screaming in terror like his passengers!!!
|
|
|
|
|
While a BSTR can technically contain any data at all, it's most often used to hold a C-style (zero-terminated) UTF-16 string. Many BSTR wrappers also make the same assumption. Step into the COleVariant code and see if it is doing this.
--Mike--
Visual C++ MVP
LINKS~! Ericahist | PimpFish | CP SearchBar v3.0 | C++ Forum FAQ
VB > soccer
|
|
|
|
|
If no other solution, you can use an alternative approach, based on STL strings: std::wstring for Unicode or std::string for ANSI. This kind of strings allows null character within the string.
For instance:
std::wstring s = L"abc";
s += L'\0';
s += L"def";
size_t length = s.length();
wchar_t c;
c = s[2];
c = s[3];
c = s[4];
const wchar_t * p = s.c_str();
Next, if you need this as OLE variant, I think you can use "safe arrays" for this. For instance, this fragment copies the above string to a safe array:
CComSafeArray< USHORT > sa;
sa.Add(s.length() + 1, (USHORT*)p);
Hope it helps.
-- modified at 3:58 Friday 16th June, 2006
|
|
|
|
|
Thanks for the suggestions. I managed to fix(hack) it. I was already using safe arrays as the task I'm performing must communicate with older COM and OLE objects. The problem seemed to be an error in one of the OLE cpp files in the MSVS directory. It seemed to call a standard strlen function regardless of the input type so I've changed the code to check for unicode and call wcslen if needed.
When I die I'd like to go peacefully in my sleep like my father, not screaming in terror like his passengers!!!
|
|
|
|
|
hi,
I got your reply and i follow it and i set up all directories which you mention in mail and ide also. you send me path and i click that path i got the page microsoft and in this page there some resolution and i follow the 2nd resolution in which the spawning error is mention and some process how you eliminate spawning error. but i am not succed in that i properly follow the step but still i got spawning error. tell the region how can i eliminate the spawning vcspawn.exe error.
Thanks
Nitin Dalal.
nitin
|
|
|
|
|
In my view, you should just uninstall visual studio or visual c++ what ever you have installed and reinstall it.
It would take not more then 30 min. Do it and then tell us if problem remains.
Wishing you best of luck...
We Believe in Excellence
www.aqueelmirza.cjb.net
|
|
|
|
|
hi,
It's nitin and you sent me answer of my question thanks for that.
because i am struggling with this error from three days and you me good solution.
once again thanks for that.if you have personal mail then send me back.
my e-mail: nitin.dalal@tatatechnologies.com and nitinb2004@yahoo.co.in.
Thanks...........
Nitin dalal
Tata technologies ltd.
Pune.
nitin
|
|
|
|
|
Can anybody temme how do i write/save a web page retrieved from internet server as a complete htm document..wid d accompanying folder containing all graphics,images?
Foll is a code which writes just d htm document on2 d disk of my m/c...
CString url2;
url2="www.google.com";
CString filepath;
filepath = "E:";
CString url3=url2.Mid(11,7);
filepath+=url3;
filepath+=".htm";
CFile myfile(filepath, CFile::modeCreate|CFile::modeWrite|CFile::typeBinary);
//buf=where the page read is stored
//len=length of page read
while ((numread = pFile->Read(buf,len)) > 0)
{
myfile.Write(buf, numread);
}
myfile.Close();
|
|
|
|
|
See this:
http://www.codeguru.com/cpp/i-n/ieprogram/article.php/c4397/
Cheers
"Peace of mind through Technology"
|
|
|
|
|
Hi Guys,
Can u please refer some source code for studying Database access using MFC. What I need is, how to access a database ( say Microsoft Access ) through an MFC program.
Regards
Velayudhan
|
|
|
|
|
See Here[^]
Somethings seem HARD to do, until we know how to do them.
_AnShUmAn_
|
|
|
|
|
Thank You
|
|
|
|
|
Hi,
I have the following prototype in ActiveX to send the Array from my client program. The variable VarArray contains array of values, Can you please provide me an example to get the values of each index by using SafeArray.
void CSimpleAdditionAtxCtrl::Final(VARIANT* VarArray)
{
}
|
|
|
|
|
VARIANT varBuffer;
------------------
if(varBuffer.vt==(VT_ARRAY|VT_UI1))
{
DWORD dwSize=varBuffer.parray->rgsabound[0].cElements;
BYTE lpBuffer=new BYTE[dwSize];
memcpy( lpBuffer , varBuffer.parray->pvData,dwSize);
delete []lpBuffer;
}
alantop
|
|
|
|
|
sivaprakashshanmugam wrote: I have the following prototype in ActiveX to send the Array from my client program. The variable VarArray contains array of values, Can you please provide me an example to get the values of each index by using SafeArray.
Here m_vecIcecreamFlavors and m_vecIcecreamPrices are vecters of BSTR and float resp.
SAFEARRAYBOUND safeBound[2]; <br />
<br />
safeBound[0].cElements = m_vecIcecreamFlavors.size(); <br />
safeBound[0].lLbound = 0;<br />
<br />
safeBound[1].cElements = m_vecIcecreamPrices.size();<br />
safeBound[1].lLbound = 0 ;<br />
<br />
<br />
VariantInit(VarArray);<br />
pVariant->vt = VT_VARIANT | VT_ARRAY; <br />
pVariant->parray = SafeArrayCreate(VT_VARIANT,2,safeBound);<br />
<br />
<br />
std::vector<CComBSTR>::iterator iterFlavor;<br />
std::vector<float>::iterator iterPrices;<br />
<br />
<br />
<br />
long lDimension[2];<br />
int iFlavorIndex = 0;<br />
<br />
<br />
iterPrices = m_vecIcecreamPrices.begin();<br />
iterFlavor = m_vecIcecreamFlavors.begin(); <br />
<br />
<br />
while(iterFlavor != m_vecIcecreamFlavors.end()) <br />
{<br />
<br />
<br />
lDimension[1] = iFlavorIndex;<br />
lDimension[0] = 0;<br />
CComVariant variantFlavor(SysAllocString((*iterFlavor).m_str));<br />
SafeArrayPutElement(pVariant->parray,lDimension,&variantFlavor);<br />
<br />
<br />
<br />
lDimension[1] = iFlavorIndex;<br />
lDimension[0] = 1;<br />
CComVariant variantPrices(*iterPrices);<br />
SafeArrayPutElement(pVariant->parray,lDimension,&variantPrices);<br />
<br />
<br />
iFlavorIndex++;<br />
iterPrices++;<br />
iterFlavor++;<br />
<br />
<br />
}
Suppose Variant result is parameter passed for fillup then we can retrive the elements from the array as follows.
long lUDimension,lLDimension;<br />
<br />
SafeArrayGetUBound(result->parray,2,&lUDimension);<br />
SafeArrayGetLBound(result->parray,2,&lLDimension);<br />
VARIANT val[2];<br />
long Dimension[2];<br />
<br />
for(LONG i=lLDimension;i<=lUDimension;i++)<br />
{<br />
m_Data.InsertItem(i," ");<br />
Dimension[0]=0;<br />
Dimension[1]=i; <br />
HRESULT hr=SafeArrayGetElement(result->parray,Dimension,(void*)&val[0]);<br />
if(FAILED(hr))<br />
AfxMessageBox("Unable to read 1 element");<br />
m_Data.SetItemText(i,0,_com_util::ConvertBSTRToString(val[0].bstrVal));<br />
Dimension[0]=1;<br />
Dimension[1]=i; <br />
hr=SafeArrayGetElement(result->parray,Dimension,(void*)&val[1]);<br />
if(FAILED(hr))<br />
AfxMessageBox("Unable to read 2 element");<br />
m_Data.SetItemText(i,1,_com_util::ConvertBSTRToString(val[1].bstrVal));<br />
}
Knock out 't' from can't,
You can if you think you can
|
|
|
|
|
how can you make a listboxctrl show what line is selected without clicking on the line? a list of mp3's say i click the first one its hilited but when i click the next button i need it to hilite that one but i cant figure it out i tryed all the commands i could find.
|
|
|
|
|
Which control r u using ListCtrl or Listbox ?
nave
|
|
|
|
|