|
How are you implementing the Menu? Are you using a CMenu creation directly, or did you use a resource?
|
|
|
|
|
Is there anyway to insert a CButton control in a CListCtrl cell.
Thanks in advance,
Ron
|
|
|
|
|
There is always a way, but it doesn't seem practical for a CListCtrl. What you probably want is to use some type of grid control instead. There are a lot of them on this site and I think most of them support embedded controls.
-- Rocky Dean Pulley
|
|
|
|
|
Thanks for the reply. I'll look at one of the grid controls. I was just trying to save an existing app.
Thanks again,
Ron
|
|
|
|
|
hello , i am a new vc++ programmer , i want to create an xml file using msxml3.0 in vc++.
THe msdn code i had used , but i receive several errors in that.
error C2872: 'IXMLDocumentPtr' : ambiguous symbol
error C2065: 'IDOMDocumentPtr' : undeclared identifier
error C2065: 'myDOMPtr' : undeclared identifier
error C2228: left of '.CreateInstance' must have
Error executing cl.exe.
Can i need have the proper code 4 that.
Rahul Agarwal
|
|
|
|
|
Hi Rahul,
Please Check that you correctly imported msxml3.dll in your project or not.
Please post your COM related query in there specialized forums for COM[^] and forATL[^] , as there you can find programmer which are specialized in COM/ATL and they help you to sort out your query more quickly
OK
"I Think this Will Help"
<h5
alok gupta="" <br=""> visit me at http://www.thisisalok.tk
|
|
|
|
|
for example i have such string C:\asdf\fdsa
I want to check out if they exist, if not then create them
|
|
|
|
|
|
There is a fundamental problem with only using the _access method described earlier, it is POSSIBLE that you are looking at a FILE with the name 'fdsa' in the 'asdf' folder! You should ALWAYS verify that it exists AND it is a directory, if that is your true requirement!
<br />
DWORD dwAttributes = GetFileAttributes("C:\\asdf\\fdsa");<br />
<br />
if( dwAttributes != (DWORD)-1 ){<br />
<br />
if( dwAttributes & FILE_ATTRIBUTE_DIRECTORY ){<br />
} else {<br />
}<br />
<br />
} else {<br />
<br />
dwAttributes = GetFileAttributes("C:\\asdf");<br />
<br />
if( dwAttributes != (DWORD)-1 ){<br />
if( dwAttributes & FILE_ATTRIBUTE_DIRECTORY ){<br />
} else {<br />
} <br />
} else {<br />
}<br />
}<br />
...and you wanted to write robust software...
|
|
|
|
|
bool dirExists
(CString strDirectory)
{
TCHAR* fullPath = _tfullpath (NULL, strDirectory, 0);
if (fullPath == NULL)
return (false);
TCHAR szCurrDir [_MAX_PATH];
_tgetcwd (szCurrDir, _MAX_PATH - 1);
long nStatus = _tchdir (fullPath);
_tchdir (szCurrDir);
free (fullPath);
if (nStatus == 0)
return (true);
return (false);
} /ravi
My new year's resolution: 2048 x 1536
Home | Articles | Freeware | Music
ravib@ravib.com
|
|
|
|
|
|
hi,
can any one help me in adding a new display mode in Win98...like iwant to add a reverse mode like say 600 x 800 ,I did the changes in the registry but the change is not seen the right click \ properties \settings \..the slider to change the the resolution......
I was able to do it in Win2k by setting the mode prunning to 1...
is there any way for win98...ist really making me crazy for the last two days...
Any help would be gratefully appreciated...
thnx in advance..
udaykumar
|
|
|
|
|
hai all,
i want to no how to pack all my bitmap images into a dll by using Visual C++6.0,
do i need to follow any specific steps...
regards
expl
|
|
|
|
|
vc++ 6.0->Insert->Bitmap->Import
suhredayan There is no spoon.
|
|
|
|
|
I use a datagram socket to receive UDP message. Now a new requirement is to automatically reply to the messages senders. Application messages doesn't containt the IP address and the Port of the sender. How can I know who have I to reply ? Is it possible to retrieve the sender information with low level functions ? or have I to use a RAW socket ?
Thanks a lot.
|
|
|
|
|
I want to sort elements pointed by a double pointer and update the index of elements accordingly.
For example, I have elements pointed by the double pointer:
double ptr;
ptr[0] = -8;
ptr[1] = -9;
ptr[2] = 5.6;
ptr[3] = 3.4;
ptr[4] = 0;
I want to sort these elements and return the updated index:
ptr[0] = -9;
ptr[1] = -8;
ptr[2] = 0;
ptr[3] = 3.4;
ptr[4] = 5.6;
index[0] = 1
index[1] = 0
index[2] = 4
index[3] = 3
index[4] = 2
What library can I use?
Can I use qsort() to do this?
Thanks
|
|
|
|
|
I presume ptr is supposed to be declared as ptr[5] ? The closest I could come up with looks like:
struct _ptr
{
double d;
int n;
} ptr[5] = {{-8, 0},{-9, 1},{5.6, 2},{3.4, 3},{0, 4}};
int Compare( const void *p1, const void *p2 )
{
if (((_ptr *) p1)->d < ((_ptr *) p2)->d)
return -1;
else if (((_ptr *) p1)->d > ((_ptr *) p2)->d)
return 1;
else
return 0;
}
void main( void )
{
qsort(ptr, sizeof(ptr) / sizeof(ptr[0]), sizeof(ptr[0]), Compare);
return;
}
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
|
|
|
|
|
It seems not work.
What I want to do is to sort a double pointer which points to a array.
There is also an index pointer points to the index location, after I sort the data pointer, the index elements are rearrange according to the sorted data.
For example, I have a double pointer ptrdata.
double *ptrData = (double*)calloc(5, sizeof(double));
double *ptrIndex = double*)calloc(5, sizeof(double));
ptrData[0] = 3; ptrData[1] = 4; ptrData[2] = 2; ptrData[3] = 5;
ptrData[4] = 6;
ptrIndex[0] = 1; ptrIndex[1] = 2; ptrIndex[2] = 3; ptrIndex[3] = 4;
ptrIndex[4] = 5;
After sorting:
ptrData[0] = 2; ptrData[1] = 3; ptrData[2] = 4; ptrData[3] = 5;
ptrData[4] = 6;
ptrIndex[0] = 3; ptrIndex[1] = 1; ptrIndex[2] = 2; ptrIndex[3] = 4;
ptrIndex[4] = 5;
I know qsort can sort the elements quickly, but howcan I aso re-arrange the index with the use of qsort?
Thanks
|
|
|
|
|
I'm not sure if you even tried the code snippet that I provided but it does produce the answer you are after. Change main() to the following to verify:
void main( void )
{
cout << "Number Index" << endl;
cout << "------ -----" << endl;
for (int x = 0; x < 5; x++)
cout << " " << ptr[x].d << " " << ptr[x].n << endl;
qsort(ptr, sizeof(ptr) / sizeof(ptr[0]), sizeof(ptr[0]), Compare);
cout << endl;
for (x = 0; x < 5; x++)
cout << " " << ptr[x].d << " " << ptr[x].n << endl;
}
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
|
|
|
|
|
When I'm stepping through my c++ code with the Visual Studio .Net 2003 debugger, my Windows XP SP2 system quite often hangs. A college of mine has the same problem. Any one else experienced the same problem? Got a sollution?
|
|
|
|
|
Same here with Windows XP SP2.
suhredayan There is no spoon.
|
|
|
|
|
Yes, just recently had the same problem. For me it turned out to be Nvidia's NView program that manages windows. Turn this off completely and my problems went away. I'm running a Toshiba laptop so I couldn't upgrade to the newest version of Nvidia drivers, but I wasn't using it NView anyways so I just turned it off.
Hope this helps.
--
Joel Lucsy
|
|
|
|
|
The code that i have sent you is not doing any thing. It is only working to open a webpage.
We Believe in Excellence
|
|
|
|
|
Perhaps the file extension of the file you are opening is assocciated with internet explorer or the internet? If you posted your code for the ShellExecute we could probably help you.
|
|
|
|
|
Here is my code...
void CPrintDlg::OnBPrint()
{
ShellExecute(NULL, "print", "c:\\Print\\myfile.doc", NULL, NULL, 0);
}
We Believe in Excellence
|
|
|
|