|
Hi Randor,
I'm not - it isn't a report style CListCtrl, it's an icon style CListCtrl. I understand that column width isn't set with an icon style CListCtrl.
Regards,
Sternocera
|
|
|
|
|
Have you entertained the possibility of a bad/corrupt/outdated icon cache? I've had it happen once with an older version of Windows, so it's probably not a common problem.
"Old age is like a bank account. You withdraw later in life what you have deposited along the way." - Unknown
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
|
|
|
|
|
That seems like a reasonable explanation. I've found that moving the initialisation of the icons into OnIntialUpdate seems to fix the problem, but I'm not overly confident that it hasn't just temporarily concealed the problem.
I'll delete the cache to be sure.
Regards,
Sternocera
|
|
|
|
|
Where is imgl declared? Is its lifetime longer than the lifetime of the list control?
It's a good idea to always zero-init structs, like LVITEM , so that you aren't accidentally sending garbage data in the members that you don't explicitly set.
--Mike--
Dunder-Mifflin, this is Pam
|
|
|
|
|
Hi Mike,
Yes, imgl is declared in the same class definition as the CListCtrl. I have now zero initialised the LVITEM structs. Thanks for your help.
Regards,
Sternocera
|
|
|
|
|
There is a method that allows adjustment of the icon width: SetIconSpacing() You might try playing around with that.
|
|
|
|
|
I haven't had a re-occurrence since I simply initialised my structs, but thanks for pointing that out.
|
|
|
|
|
Hi,
I am working on an application, which calls a WPF page in MFC exe and loads it too, but the backgound for the WPF is coming black.
here is code snippet
Declaration
using namespace System;
using namespace System::Windows;
using namespace System::Windows::Controls;
using namespace System::Windows::Media;
ref class Globals
{
public:
static System::Windows::Interop::HwndSource^ gHwndSource;
static WpfApplication1::Window1^ gwcContainer;
};
i have added in oninitdialog,
System::Windows::Interop::HwndSourceParameters^ sourceParams = gcnew System::Windows::Interop::HwndSourceParameters("MyWindowName");
sourceParams->PositionX = 20;
sourceParams->PositionY = 30;
sourceParams->ParentWindow = System::IntPtr(this->GetSafeHwnd());
sourceParams->WindowStyle = WS_VISIBLE | WS_CHILD;
System::Windows::Interop::HwndSource^ source = gcnew System::Windows::Interop::HwndSource(*sourceParams);
source->SizeToContent = System::Windows::SizeToContent::WidthAndHeight;
Globals::gwcContainer = gcnew WpfApplication1::Window1();
FrameworkElement^ myPage = Globals::gwcContainer;
source->RootVisual = myPage;
I dont want the black color around.
Any help is highly appriciated.
Thanks&Regards,
KDevloper
|
|
|
|
|
I got 1231 error value when using the code below.
1231: The network location cannot be reached. For information about network troubleshooting, see Windows Help.
my lan and internet is working fine.
then where is actually the problem residing.
HANDLE hIcmpFile;
unsigned long ipaddr = INADDR_NONE;
DWORD dwRetVal = 0;
char SendData[] = "Data Buffer";
LPVOID ReplyBuffer = NULL;
DWORD ReplySize = 0;
ipaddr = inet_addr((const char*)m_sAddress);
ReplySize = sizeof(ICMP_ECHO_REPLY) + sizeof(SendData) +1;
ReplyBuffer = (VOID*)malloc(ReplySize);
hIcmpFile = IcmpCreateFile();
if (hIcmpFile == INVALID_HANDLE_VALUE)
{
return -1;
}
dwRetVal = IcmpSendEcho(hIcmpFile, ipaddr, SendData, sizeof(SendData) + sizeof(ICMP_ECHO_REPLY), NULL, ReplyBuffer, ReplySize, 500);
if(dwRetVal != 0)
{
PICMP_ECHO_REPLY pEchoReply = (PICMP_ECHO_REPLY)ReplyBuffer;
struct in_addr ReplyAddr;
ReplyAddr.S_un.S_addr = pEchoReply->Address;
m_sMessage.Format(_T("Received from %s Status = %ld RoundTripTime = %ld"), inet_ntoa(ReplyAddr), pEchoReply->Status, pEchoReply->RoundTripTime);
return 0;
}
Future Lies in Present.
Manmohan Bishnoi
|
|
|
|
|
If you want to use ping from your application, have a look at boost::asio. Boost have a ping example program that you may be able to adopt. Note that your application requires administrative privileges on Vista to create ICMP packets.
Regards,
Sternocera
|
|
|
|
|
Manmohan29 wrote: I got 1231 error value when using the code below.
From GetLastError() ?
"Old age is like a bank account. You withdraw later in life what you have deposited along the way." - Unknown
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
|
|
|
|
|
yes
Future Lies in Present.
Manmohan Bishnoi
|
|
|
|
|
Do you get that error for all addresses?
"Old age is like a bank account. You withdraw later in life what you have deposited along the way." - Unknown
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
|
|
|
|
|
yes same for all IP's.
My OS is Windows Seven RC.
I have also tested this on XP. There also the problem is same.
Future Lies in Present.
Manmohan Bishnoi
|
|
|
|
|
I suggest you try others examples from here.
"Old age is like a bank account. You withdraw later in life what you have deposited along the way." - Unknown
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
|
|
|
|
|
How to plug/unplug USB serial port problematically?
I am facing some strange issue with my USB serial port.
I want to unplug and plug the USB Serial port Programitically, as i need to refresh the connection between system and hardware connected.Kindly help.......
Thank in advance for the great programmers
|
|
|
|
|
pallaka wrote: I want to unplug and plug the USB Serial port Programitically, as i need to refresh the connection between system and hardware connected.
You cannot do that from user mode. You must ask the driver for that functionality if it supports it at all, which I doubt when it comes to serial port drivers for USB.
pallaka wrote: I am facing some strange issue with my USB serial port.
Perhaps you can elaborate on what the "strange issue" is all about.
It's quite possible that there is another solution than resetting the port/device.
What have you done so far and what problems are you facing that you want to solve by resetting the port?
"It's supposed to be hard, otherwise anybody could do it!" - selfquote "High speed never compensates for wrong direction!" - unknown
|
|
|
|
|
Hi All,
I have a basic question , i have a dialog based application and in the App class we create an object for the dialog class and do DoModal()in InitInstance() of the App class ..
Can anyone tell me when Run the Application How the InitInstance will get called or the other of calls made which calls the App classes InitInstance()
Thanks,
Hari
|
|
|
|
|
There's a very easy way to check that: put a breakpoint in the function and start your debugger. Once the breakpoint is hit, take a look at the callstack.
|
|
|
|
|
I tried it and it says AfxWinMain() can anybody explain in detail and thks for the quick reply.
|
|
|
|
|
Hari_16 wrote: can anybody explain in detail
See here[^]. It's an old article but I think it will already give you valuable information.
|
|
|
|
|
Hari_16 wrote: Who calls InitInstance()?
God.
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
CPallini wrote: Hari_16 wrote:
Who calls InitInstance()?
God.
I realize now why he's so busy these days....
Most problems in the world that some people are waiting for God to solve will remain due to all his calls to InitInstance() ....
Revolutionary - I've never thought of it that way before!
"It's supposed to be hard, otherwise anybody could do it!" - selfquote "High speed never compensates for wrong direction!" - unknown
|
|
|
|
|
Roger Stoltz wrote: Most problems in the world that some people are waiting for God to solve will remain due to all his calls to InitInstance()....
However, as balance, there are all the missed problems due to the lack of God's intervention...
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
hi,
i want to modify the return value of a file query.
i tried to achieve it by modifying the IRP_MJ_QUERY_INFORMATION in FileStandardInformation.
but it doesn't work, someone can help me?
thank you soooooooo much!!
modified on Tuesday, October 27, 2009 7:22 AM
|
|
|
|