|
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.
|
|
|
|
|
User fscanf/fread to scan through the file and go to the required line
Once the required line is found, use fseek to go back to the start of the line
Do a fprintf/fwrite again.
Keep in mind that if the new line is longer that the line in the file, it will overwrite entries in the next line. You will have to devise a appropriate insertion/modify strategy if the line lengths can be different.
|
|
|
|
|
From ABC.TXT, write all lines up to the line to be replaced into a temporary file. Write the new line into the temporary file. Write the remaining lines from ABC.TXT into the temporary file. Delete ABC.TXT. Rename the temporary file to ABC.TXT. Make sense?
"The largest fire starts but with the smallest spark." - David Crow
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
Try something like this (haven't tested this).
----------------------------------------------
#incluce <iostream>
#include <fstream>
#include <string>
int main(int argc, char* argv[])
{
using namespace std;
// Open files.
ifstream inf("C:\\in.txt");
if (!inf)
{
cerr << "Failed to open input file" << endl;
return 1;
}
ofstream outf("C:\\out.txt");
if (!outf)
{
cerr << "Failed to open output file" << endl;
return 1;
}
// Copy the input file to the output file line by line replacing as needed.
string line;
while (getline(inf, line))
{
if (line=="Replace this line")
{
outf << "With this line" << endl;
}
else
{
outf << line << endl;
}
}
return 0;
}
Steve
|
|
|
|
|
I need to intercept the GDI ::GetPixel() API. I need to get the screen coordinates before GDI can do it's default processing. I need this capability on Win98/ME/2000/XP. Here is what I have found out so far -
1. The SetDDIHook API seems to be gone. Not sure if it is still available to program as part of VS 6.0 headers/libraries. The API documentation mentions something about 16 bit DLLs, so again not sure if it applies to the 32 bit OSs that I am interested in.
2. Would writing a filter video driver do the job? If so, where would I get the IOCTL codes for GetPixel that needs to be intercepted? I assume there is some IOCTL code for GetPixel which the display video driver would look at.
-- modified at 1:16 Monday 3rd July, 2006
|
|
|
|
|
The dialog window can be resize and it max is full screen. how to fix the min size of the dialog??? Thx.
|
|
|
|
|
Handle 'WM_GETMINMAXINFO' message:
void CMyWindow::OnGetMinMaxInfo(MINMAXINFO FAR* lpMMI)
{
lpMMI->ptMinTrackSize.x = 200;
lpMMI->ptMinTrackSize.y = 150;
}
Ovidiu Cucu
Microsoft MVP - Visual C++
|
|
|
|
|
thz x 100000000000000000000000
|
|
|
|