|
That looks correct to me - do you have it in the correct location? If not embedded, it should be in an external file named the same as your executable file with .manifest appended to it.
For example, if your executable is called MyApp.exe , the manifest file should be MyApp.exe.manifest , and kept in the same directory that the executable is in.
Peace!
-=- James Please rate this message - let me know if I helped or not!<HR> If you think it costs a lot to do it right, just wait until you find out how much it costs to do it wrong! Avoid driving a vehicle taller than you and remember that Professional Driver on Closed Course does not mean your Dumb Ass on a Public Road! See DeleteFXPFiles
|
|
|
|
|
James
Many thanks for your help. I've finally sorted it! I've added an external manifest (ensuring the language is set to English(US) in the resource properties, and as if by magic, the XP Themes are applied.
Graham
|
|
|
|
|
Hi everyone
Ive recently been tasked to add a bitmap to a listctrl, which ive done sucessfully, with a little help from Matt Weagle's excellent article (http://www.codeproject.com/listctrl/listctrldemo.asp[]
However, when text is placed over it, the text background color is white (which obviously obcures the image).
This was fine - even the demo app does this, but having passed this code to my collegue, his bitmap doesnt get obscured. We are using the same code, environment, both using Visual Studio 2003. Checked everything I can think of (project settings, resource & stdafx files etc.).
Can anyone help please?
|
|
|
|
|
What is the code you're using to place text over the bitmap?
Mark
|
|
|
|
|
Hi Mark
>Mark Salsbery wrote:
>What is the code you're using to place text over the bitmap?
Its a standard SDI app:
void MyRightView::OnInitialUpdate()
{
CListView::OnInitialUpdate();
CListCtrl& ctlList = (CListCtrl&) GetListCtrl();
ModifyStyle ( LVS_TYPEMASK,LVS_REPORT);
ListView_SetExtendedListViewStyle (m_hWnd, LVS_EX_FULLROWSELECT | LVS_EX_GRIDLINES | LVS_EX_HEADERDRAGDROP);
ctlList.InsertColumn(1,"A",NULL,50,NULL);
ctlList.InsertColumn(2,"B",NULL,100,NULL);
ctlList.InsertColumn(3,"C",NULL,100,NULL);
ctlList.InsertColumn(4,"D",NULL,50,NULL);
ctlList.InsertColumn(5,"E",NULL,80,NULL);
ctlList.InsertColumn(6,"F",NULL,50,NULL);
ctlList.DeleteAllItems();
for (int f=0; f<20;f++)
DisplayLine(f);
EnableBkImage(TRUE);
}
void MyRightView::DisplayLine(int line)
{
CListCtrl& ctlList = (CListCtrl&) GetListCtrl();
ctlList.InsertItem(line,_T("12345"),0);
ctlList.SetItemText(line,1,_T("Test"));
ctlList.SetItemText(line,2,_T("A"));
ctlList.SetItemText(line,3,_T("1F"));
ctlList.SetItemText(line,4,_T("2006-12-1"));
ctlList.SetItemText(line,5,_T("AM (N)"));
ctlList.SetItemText(line,6,_T("22-12-2006"));
}
void MyRightView::EnableBkImage(BOOL bEnable)
{
CListCtrl& ctlList = (CListCtrl&) GetListCtrl();
if (bEnable)
{
// Load the resource and apply it to the background
TCHAR szBuffer[_MAX_PATH];
VERIFY(::GetModuleFileName(AfxGetInstanceHandle(), szBuffer, _MAX_PATH));
CString sPath;
sPath.Format(_T("res://%s/#2/#139"),szBuffer);
LVBKIMAGE bki;
bki.ulFlags = LVBKIF_STYLE_NORMAL | LVBKIF_SOURCE_URL ; //LVBKIF_STYLE_TILE
bki.pszImage = sPath.GetBuffer(sPath.GetLength());
bki.cchImageMax = sPath.GetLength();
bki.xOffsetPercent= 50;
bki.yOffsetPercent=50;
VERIFY(ctlList.SetBkImage( &bki));
}
else
ctlList.SetBkImage( HBITMAP(0));
}
|
|
|
|
|
Can you show your code(of course not all )
|
|
|
|
|
Hi
Mangaged to fix this - 1 line of code (strangly my collegue doesnt need to use this though )
ctlList.SetTextBkColor(CLR_NONE);
pity MSDN doesnt seem give you a list of these parameters
Thank you for your attention!
|
|
|
|
|
thefainster wrote: Mangaged to fix this
Cool
It's good practice IMO to always setup drawing the way you want it so you don't rely on behavior
between machines.
Glad you got it fixed!
Mark
|
|
|
|
|
Hi All,
is it possible to search & find a specific MAC address of NIC card without knowing the IP address or any other details?
B Regards
Ajith
Ajith
|
|
|
|
|
IP Helper has the GetAdaptersInfo() API to get info on all the adapters on the computer,
including the hardware address and associated IP address(es).
Maybe this helps?
Mark
|
|
|
|
|
hello, I search a source for a client/serveur of mailslot or somebody which are motivated to help me to do one (I can dream no? )
thanks and sorry for the english
|
|
|
|
|
Go Here[^] and search for mailslot .
Peace!
-=- James Please rate this message - let me know if I helped or not!<HR> If you think it costs a lot to do it right, just wait until you find out how much it costs to do it wrong! Avoid driving a vehicle taller than you and remember that Professional Driver on Closed Course does not mean your Dumb Ass on a Public Road! See DeleteFXPFiles
|
|
|
|
|
|
I try to run step by step code below but I can't go in to "CALLBACK EnumChildProc".
What wrong in my code?
void CHideWindowsDlg::OnGethandle()
{
CString strText;
HWND hWndAppearance = NULL;
HWND hWndChild = NULL;
GetDlgItemText(IDC_EDIT,strText);
hWndAppearance = ::FindWindow(NULL,_T(strText));
if(hWndAppearance)
{
EnumChildWindows(hWndAppearance, EnumChildProc,(LPARAM)&hWndChild);
if(hWndChild)
{
.....
.....
}
}
}
BOOL CALLBACK EnumChildProc(HWND hWnd, LPARAM lParam)
{
TCHAR buff[512];
GetWindowText(hWnd,buff,512);
if(_tcscmp(buff,_T("&1234")) == 0)
{
*reinterpret_cast<HWND*>(lParam) = hWnd;
return FALSE;
}
return TRUE;
}
|
|
|
|
|
You cannot easily step-into the callback function, but you should be able to set a breakpoint at the start of it and hit it.
If your callback is not firing at all, there is something wrong with the call to EnumChildWindows(...) - be sure to check its return code and/or ::GetLastError(...) .
Peace!
-=- James Please rate this message - let me know if I helped or not!<HR> If you think it costs a lot to do it right, just wait until you find out how much it costs to do it wrong! Avoid driving a vehicle taller than you and remember that Professional Driver on Closed Course does not mean your Dumb Ass on a Public Road! See DeleteFXPFiles
|
|
|
|
|
Hi friends,
Sorry for such basic question. but I wanted to know where does new operator or malloc operator allocate memory? in actualy physical memory or virtual memory?
Vikram S
|
|
|
|
|
All code in user space allocates in virtual memory (mapped by the operating system). You do not have access to physical memory (nor would you want to!)
--
Verletzen zerfetzen zersetzen zerstören
Doch es darf nicht mir gehören
Ich muss zerstören
|
|
|
|
|
Correct. There are two things
1) I get virtual address space
2) I get virtual memory : here I guess when my Main memory exceeds then OS gives me more memory from disk as a page file.
So I meant to know that when I request for the memory from where the OS gives me memory by reserving the space from actual Main memory or from page file?
-- modified at 10:26 Thursday 4th January, 2007
|
|
|
|
|
It reserves space in your process' virtual address space. The contents of that memory may be in physical memory (or your CPU's cache) or in the page file, or both. The OS decides when to swap (or page-in/page-out) data between physical memory and the page file.
Peace!
-=- James Please rate this message - let me know if I helped or not!<HR> If you think it costs a lot to do it right, just wait until you find out how much it costs to do it wrong! Avoid driving a vehicle taller than you and remember that Professional Driver on Closed Course does not mean your Dumb Ass on a Public Road! See DeleteFXPFiles
|
|
|
|
|
I must admit that I misread your question at first. I thought you wanted physical addresses as opposed to virtual addresses.
vikrams wrote: So I meant to day that when I request for the memory from where the OS gives me memory by reserving the space from actual Main memory or from page file?
Malloc and new, will use your process local heap, which will just ask the kernel for a chunk of memory every now and then. It's up the OS to decide where your chunk of memory will actually reside - it will try to be as efficient as possible.
Functions like VirtualAlloc() allows you to specify that you must be given physical memory. I suppose that misusing this function may render the system unusable though. It depends on how strong the contract between the caller and the kernel is. If the kernel comes to the conclusion that "I really really really have to swap these pages out to disk now!" and you have specified MEM_PHYSICAL, the outcome can be one of two: it keeps the promise it gave with VirtualAlloc() or it silently moves your physical pages to disk despite your requirements. Maybe someone here in the forum could explain more about such memory allocations. You could always google for VirtualAlloc() and see if there are any articles out there describing the details about allocating physical memory pages.
I recommend checking out Old New Thing[^]. I'm sure that blog has covered allocating memory using this function.
--
Verletzen zerfetzen zersetzen zerstören
Doch es darf nicht mir gehören
Ich muss zerstören
|
|
|
|
|
Okey.
Here I tried writing simple program on windows which will allocate huge chunk of memory. When I ran the program with Windows task manager open (performance tab) it shows the physical memory utilization is increased.
|
|
|
|
|
If there is enough physical memory available, Windows will do its best to give it to you.
--
Verletzen zerfetzen zersetzen zerstören
Doch es darf nicht mir gehören
Ich muss zerstören
|
|
|
|
|
Say if we ve certain private methods along with private data members and public methods.
other than friend functions is thr any other way we access these members(they being private only) directly. its one of the requirements in a project of mine.
plz hlp
There are only two kinds of people who are really fascinating-people who know absolutely everything, and people who know absolutely nothing.
Oscar Wilde (1854-1900)
SH UVIK
|
|
|
|
|
Yes. If you know the binary layout of the objects, you can always access the data. If you are protecting sensitive data by making it private, it will not be sufficient.
class Class {
private:
int mySecretInt;
....
};
Class obj;
int* ptrToSecretInt = (int*)(((unsigned char*)&obj) + offset);
*ptrToSecretInt = 1234;
From a language point of view, there is no standard and portable way to access the data.
--
Verletzen zerfetzen zersetzen zerstören
Doch es darf nicht mir gehören
Ich muss zerstören
|
|
|
|
|
if we are given n .obj file n header file is tht u mean i can carry out the above. I mght nt have the source code.
There are only two kinds of people who are really fascinating-people who know absolutely everything, and people who know absolutely nothing.
Oscar Wilde (1854-1900)
SH UVIK
|
|
|
|