|
|
Are you trying to browse for a file?
for that purpose use CFileDialog
CFileDialog d(true);
d.DoModal();
CString strPath = d.GetPathName();
SaRath.
"It is your attitude, not your aptitude, that determines your altitude - Zig Ziglar."
My Blog | Understanding State Pattern in C++
|
|
|
|
|
no, what i want is i have filename and i want the path of the file name.
so that i can use this path .
ram
|
|
|
|
|
What problem are you facing using the GetFullPathName() as I suggest in my post?
Somethings seem HARD to do, until we know how to do them.
_AnShUmAn_
|
|
|
|
|
How to get this file?
whitesky
|
|
|
|
|
i have file name and i want to do get the path of the file name.so that i can play a song
ram.
|
|
|
|
|
You have a filename ok.(Test.mp3) but when you run your program how to get this file?if you can read this you can get path unless you want to save this file in your program
whitesky
|
|
|
|
|
if u want to read a file we must have a path.without knowing the path how we can read.
|
|
|
|
|
very well my friend you said path well when you have a path use from this
path for file and save this path ok (your message how to get path a file)
whitesky
|
|
|
|
|
If you have the name of the file use
GetFullPathName()
See Here[^]
Somethings seem HARD to do, until we know how to do them.
_AnShUmAn_
-- modified at 7:07 Friday 30th June, 2006
|
|
|
|
|
i used getFullPath().it is giving me the second folder path
actully my problem is i have project on Mp3PLayer.
if i add folder to the listbox all the files in the folder and if u click on thew song it wil get the path and it will work.if i add second folder to the listbox then if we click on first folder file it willnot play.
because they also taking the path of second folder.
pplase help.
ram.
-- modified at 7:51 Friday 30th June, 2006
|
|
|
|
|
You can use either PathRemoveFileSpec() or _splitpath() .
"The largest fire starts but with the smallest spark." - David Crow
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
thank u for ur response.
how we can without path how we can split path.
|
|
|
|
|
happy_ram wrote: how we can without path how we can split path.
Without a path, you cannot split the path ?
Please rephrase your question.
Maximilien Lincourt
Your Head A Splode - Strong Bad
|
|
|
|
|
Hello
I kindly ask for a source-code in vc++ to snapshot from a webcam to a bitmap (Graphics::TBitmap).
-- modified at 6:26 Friday 30th June, 2006
|
|
|
|
|
Hi
I have read a lot of articles and researched on internet but I haven't found a way to get HomeTelephoneNumber from WAB. I can get DISPLAY_NAME and EMAIL_ADDRESS but not PR_PRIMARY_TELEPHONE_NUMBER_A
This is the code
<br />
int main(int argc, char* argv[])<br />
{<br />
HINSTANCE hinstWAB=NULL;<br />
HRESULT hr=E_FAIL;<br />
<br />
HKEY keyResult;<br />
BYTE keyValue[MAX_PATH];<br />
DWORD dataout=800;<br />
char PathToWAB[255];<br />
<br />
RegOpenKeyEx(HKEY_LOCAL_MACHINE, WAB_DLL_PATH_KEY, 0, KEY_ALL_ACCESS, &keyResult);
long result = RegQueryValueEx(keyResult, "", 0, 0, keyValue, &dataout);<br />
RegCloseKey(keyResult);<br />
<br />
strcpy(PathToWAB, (char*)keyValue);<br />
<br />
HMODULE hModule = LoadLibrary(PathToWAB);<br />
<br />
if (hModule!=NULL)<br />
{<br />
ssWABOpen = (fWABOpen)GetProcAddress(hModule, "WABOpen");<br />
if (ssWABOpen == NULL) return 2;<br />
HRESULT hr = (ssWABOpen)(&lpAddrBook, &lpWABObject, NULL, 0);<br />
}<br />
<br />
<br />
hr = E_FAIL;<br />
<br />
if (ssWABOpen==NULL) return 1;
{<br />
ULONG lpcbEntryID;<br />
ENTRYID* lpEntryID;<br />
<br />
hr = lpAddrBook->GetPAB(&lpcbEntryID, &lpEntryID);<br />
if (hr!=S_OK) return 10;
<br />
ULONG ulFlags = MAPI_BEST_ACCESS,<br />
ulObjType = NULL;<br />
LPUNKNOWN lpIUnknown = NULL;<br />
hr = lpAddrBook->OpenEntry(lpcbEntryID,<br />
lpEntryID,<br />
NULL,<br />
ulFlags,<br />
&ulObjType,<br />
&lpIUnknown);<br />
<br />
ulFlags = NULL;
<br />
if (ulObjType==MAPI_ABCONT)
{<br />
IABContainer* lpABContainer = static_cast<IABContainer*>(lpIUnknown);
LPMAPITABLE lpMAPItbl = NULL;<br />
hr = lpABContainer->GetContentsTable(ulFlags, &lpMAPItbl);<br />
if(!lpMAPItbl)<br />
{<br />
printf("Error in lpMAPItbl\n");<br />
return 0;<br />
}<br />
<br />
SPropTagArray *propTag;<br />
hr = lpMAPItbl->QueryColumns(TBL_ALL_COLUMNS,(LPSPropTagArray*)&propTag);<br />
<br />
for(int j=0;j<propTag->cValues;j++)<br />
{<br />
<br />
printf("(%d)\n",propTag->aulPropTag[j]);<br />
}<br />
ULONG ulRows;
hr = lpMAPItbl->GetRowCount(0, &ulRows);<br />
if (hr!=S_OK) return 11;
<br />
SRowSet* lpRowSet;<br />
hr = lpMAPItbl->QueryRows(
ulRows,<br />
0,<br />
&lpRowSet);<br />
<br />
<br />
for (ULONG x = 0; x < lpRowSet->cRows; x++) <br />
{<br />
EMAILS thisAddr; <br />
memset(&thisAddr,0,sizeof(thisAddr));<br />
SRow* lpRow = &lpRowSet->aRow[x];
for (ULONG y = 0; y < lpRow->cValues; y++)<br />
{<br />
SPropValue* lPropVal = &lpRow->lpProps[y];<br />
lPropVal->Value.lpszA;<br />
ADRLIST adrl;<br />
adrl.cEntries = 1;<br />
adrl.aEntries[0].cValues = lpRow->cValues;<br />
adrl.aEntries[0].rgPropVals = lPropVal;<br />
<br />
SPropTagArray propTag;<br />
propTag.cValues = 1;<br />
propTag.aulPropTag[0] = PR_HOME_TELEPHONE_NUMBER_A;<br />
<br />
printf("(%x)",lPropVal->ulPropTag);<br />
switch (lPropVal->ulPropTag)<br />
{<br />
case PR_DISPLAY_NAME_A: <br />
strncpy(thisAddr.DisplayName,lPropVal->Value.lpszA,sizeof(thisAddr.DisplayName));<br />
break;<br />
<br />
case PR_ADDRTYPE_A: <br />
strncpy(thisAddr.EmailAddr,lPropVal->Value.lpszA,sizeof(thisAddr.EmailAddr));<br />
break;<br />
<br />
case PR_PRIMARY_TELEPHONE_NUMBER_A:<br />
strncpy(thisAddr.NickName,lPropVal->Value.lpszA,sizeof(thisAddr.NickName));<br />
break;<br />
<br />
default:<br />
break;<br />
}<br />
<br />
}
printf("%s\t%s\t%s\n",thisAddr.DisplayName,thisAddr.EmailAddr,thisAddr.NickName);<br />
<br />
lpWABObject->FreeBuffer(lpRow);<br />
<br />
}
lpWABObject->FreeBuffer(lpRowSet);<br />
}<br />
}<br />
<br />
<br />
<br />
FreeLibrary(hModule);<br />
return 0;<br />
}<br />
Thanks in advance.
-----------------------------
In my dream, I was dorwning my §orrow§
But my §orrow§, they learned to §wim
|
|
|
|
|
Hi
I got it solved. It was simple, but having no previous experience in MAPI gives headache.
Used this code before QueryRows.
<br />
SizedSPropTagArray(5,propArray) = {5, {PR_ENTRYID,PR_OFFICE_TELEPHONE_NUMBER,PR_BUSINESS_TELEPHONE_NUMBER,PR_HOME_TELEPHONE_NUMBER,PR_DISPLAY_NAME} };<br />
hr=lpMAPItbl->SetColumns((SPropTagArray*)&propArray,ulFlags);<br />
-----------------------------
In my dream, I was dorwning my §orrow§
But my §orrow§, they learned to §wim
|
|
|
|
|
Hi
I have a theoritical doubt in c/c++, that at the end of some functions I am seeing a const keyword. I dont know what is the purpose behind this.
for example
int function(int funcpar1,int funcpar2)const;
I want to know purpose of the const keyword at the end
Thanks
|
|
|
|
|
|
This means that the function does not modify data members of the class and does not call other functions which are not marked as const .
Functions that just read and return information must be made const . Otherwise the following sample will not work:
const CMyString s = "Test";
int length = s.GetLength();
This is because the s variable was declared as constant, se we cannot modify it.
-- modified at 6:33 Friday 30th June, 2006
|
|
|
|
|
In those const functions, we could not change an object's state (be more specific member variables value)
examples are some "Get" interfaces, those function's (most probably) are not supposed to change it's object state, it is for returning something that belong to the object.
Putting const at end of function meaningfully is a good practice.
SaRath.
"It is your attitude, not your aptitude, that determines your altitude - Zig Ziglar."
My Blog | Understanding State Pattern in C++
|
|
|
|
|
If someone know this,please help me!
request:I want to intercept screen by my will.For example I intercept intercept an area,and then save it as a bitmap or jpg.
Could you send your help to my Email mathematicianzhixin@126.com
Thanks for everyone.
|
|
|
|
|
http://www.codeproject.com/bitmap/BitmapFromScreen.asp
|
|
|
|
|
See if this helps.
"The largest fire starts but with the smallest spark." - David Crow
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
Hi..
How can we replace a line in a .TXT file using C++??
My aim is to replace a particular line in a ABC.TXT with another line from a ZYWV.TXT file??
Plz HELP ME!!
Thanks.
|
|
|
|