|
TO put an image on the button instead of making the variable of CButton type create it as CBitmapButton and use LoadBitmap to set the image on the button.;
Somethings seem HARD to do, until we know how to do them.
_AnShUmAn_
|
|
|
|
|
like this
CButton m_BitmapButton;
m_BitmapButton.Create("Test",BS_BITMAP|WS_CHILD|WS_VISIBLE,CRect(0,40,150,63),this,1);
m_BitmapButton.SetBitmap((HBITMAP)LoadImage(NULL,"c:\\0.bmp",IMAGE_BITMAP, 0, 0, LR_LOADFROMFILE|LR_CREATEDIBSECTION));
whitesky
|
|
|
|
|
ok sir but i declare this code in OnInitDialog() function
now it does not show any picture
and plz tell me my picture is .jpg so plz tellme where this code is declared
and how to show that picture
plz...............sir
Please mail me
|
|
|
|
|
I am afraid the LoadImage function from the pervious sample cannot work with JPEG file and accept BMP files only. Therefore you should check the code using some BMP file.
If it works, you have to convert your image to BMP format. For this purpose I think you can use Save As command of the Paint system accessory. Or see if Visual Studio can be used for this.
|
|
|
|
|
one way <CImage class>
whitesky
|
|
|
|
|
You dont need to create i created for this that i show this code
if you have one button set bitmap in property form button in property window or use
m_Button.ModifyStyle(0,BS_BITMAP);
(Jpg)->not problem use CImage class
and see
<br />
m_BitmapButton.Create(_T("Test"),BS_BITMAP|WS_CHILD|WS_VISIBLE,CRect(0,40,150,63),this,1);<br />
CImage m_Image;<br />
m_Image.Load(_T("e:\\0.jpg"));<br />
m_BitmapButton.SetBitmap(m_Image.Detach());<br />
//include AtlImage.h
whitesky
|
|
|
|
|
See here.
"The largest fire starts but with the smallest spark." - David Crow
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
|
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
|
|
|
|
|