|
One direction seems to be to use the
Ifolderview::SetCurrentViewMode()
Has anyone used this and could they post some code ?
Regards
|
|
|
|
|
I have a peice of code here:
CFont* pFont = NULL;<br />
LOGFONT lfNav;<br />
<br />
pFont = m_cNextPg.GetFont();<br />
pFont->GetLogFont(&lfNav);<br />
lfNav.lfHeight = 30;<br />
_tcscpy(lfNav.lfFaceName, _T("Webdings"));
m_cBtn.SetFont(CFont::FromHandle(CreateFontIndirect(&lfNav)),TRUE);
You can try it out on this piece of code by paste this code in OnInitDialog(), and be sure you have a button..
My question is: Can I change the font type to "webdings"... How to do that?
THank YOu @!
|
|
|
|
|
hi guys, i hv a application which written in VC++. and it need to use a .sys file and 2 dll file.
is there any article related to how to make a setup which can automatically place these files in the system directory. ie: WINDOWS\SYSTEM32\Drivers
thank you in advance!!
|
|
|
|
|
To do it properally you need something like InstallShield/NSIS/MSI etc etc etc.
Personally, Id go for NSIS - free, poweful, and open source.
http://nsis.sourceforge.net/home/
If its just a simple app you could write one - but why bother when someone has done it for you.
|
|
|
|
|
Hi,
I am using multithreading.
Three threads call the same function say xxx(),these three threads will be doing some processing on the items in the listcontrol,all these three threads are running.
I need to delete a particular row from the list control,when specific requirement is met.
The listcotrol is feeded by the main thread.
Can u please suggest me the way to delete the items,as the deletion is not happening the expected way.i.e,some other row is getting deleted.
|
|
|
|
|
To handle this case, you should only have one thread that ever adds/deletes/modifies items in the list control. Normally this should be the UI thread. You r worker threads should post messages to the worker thread with information that identifies the item it needs to be actioned on. This way the UI thread can look it up correctly (even if its moved) and take the right action.
Roger Allen - Sonork 100.10016
Strong Sad: I am sad I am flying
Who is your favorite Strong?
|
|
|
|
|
check out www.infogist.com,download it and run.
You see that he is able to delete and add to the list simultaneously.
|
|
|
|
|
Anonymous wrote:
You see that he is able to delete and add to the list simultaneously.
Ok, but what does that have to do with other threads updating the UI? The only thread that should be accessing the list control is its owner. All other threads, whether they are adding or deleting, should be posting a message.
"When I was born I was so surprised that I didn't talk for a year and a half." - Gracie Allen
|
|
|
|
|
Each thread should post a message, indicating what item to delete, back to the primary thread that owns the list control. Any other way is not guaranteed to work.
"When I was born I was so surprised that I didn't talk for a year and a half." - Gracie Allen
|
|
|
|
|
I have previously installed the platform sdk to a pretty dumb path.
I have cancelled the action.. but there were still some files in the directories. Tried to deinstall the platform sdk -> and then make a clean install:
pretty dumb, because it doesn't let you choose the path when installing the 2nd time.
So i tried to delete all the registry keys -> but it doesn't let you choose the path when installing the 3rd time.
Any ideas ?
"Just looking for loopholes." W. C. Fields American actor, 1880-1946, explaining why he was reading the Bible on his deathbed.
|
|
|
|
|
If you didn't successfully uninstall the platform SDK then I suggest this.
1) Install the SDK fully over the top to the directory it insists to install to.
2) Uninstall the SDK, this should now succeed.
3) Install the SDK to the directory that you want.
Hope this helps
Ant.
|
|
|
|
|
If I try to use pipe to run coomands through command.com, the program does not return even after the command.com has finished writing to the pipe. The ReadFile() function simply waits there for input on windows 98. This code is running fine on windows 2000. Does Anybody have any solution?
The part of code where the execution stops responding is:
while(1) {
succ = ReadFile(hReadPipe, buffer, sizeof(buffer)-sizeof(char), &nread, NULL);
//****** it waits here after reading all the op from the pipe***********//
if(nread == 0)
break;
buffer[nread]=0;
fwrite(buffer, strlen(buffer), 1, fp);
}
if(nread) {
buffer[nread]=0;
fwrite(buffer, strlen(buffer), 1, fp);
}
fclose(fp);
DWORD err = ::GetLastError();
::CloseHandle(hReadPipe);
Can anyone help ???
|
|
|
|
|
Have a look at this[^]. You need to use duplicate handle and close your end of the pipe, otherwise your child process will hang.
Ryan
|
|
|
|
|
Hi
Anyone Know how to change the border style of a listbox at runtime...That means when listbox is non-active, the border is not bold but it is in focus, the border is darker to indicate to the user...
I tried to use getwindowlong and setwindowlong but i am unable to set it properly..maybe i miss some APIs..
Thanx.
|
|
|
|
|
Like:
GetDlgItem(IDC_LIST1)->ModifyStyle(0, WS_THICKFRAME, SWP_DRAWFRAME);
If you say wanted to turn on WS_THICKFRAME at runtime.
Or
GetDlgItem(IDC_LIST1)->ModifyStyle(WS_THICKFRAME, 0, SWP_DRAWFRAME);
To remove
|
|
|
|
|
Hi all
I get a some complcation here:
template <class t=""> void fun(..)
{
...
switch (typeid(T))
{
case (typeid(char)):
....
break;
}
...
}
/*
This snip of code brought a compiler erro
1) typeid(T) - return const type_info& value and
this inconsistent with switch(...) - expression type
2) case(...) - expression in brackets should be const but in this case
its const referience[const type_info&]
I cant do an casting here because of type_info constructor
private.
*/
...
}
Can i avoid this error ,or i had to use if() statement,in this case.
THANKS
|
|
|
|
|
You can only switch on integral types - char , short , int , long (and their unsigned variants) and enumerated types.
You'll have to use an if statement in this case.
If you have to modify your processing based on the template parameter, then I don't thing you're really understanding the concepts of using templates. Read some articles or books on templates, particularly on partial template specialisation. "Modern C++ Design" by Andrei Alexandrescu is an extremely good book for learning about templates in depth.
Ryan "Punctuality is only a virtue for those who aren't smart enough to think of good excuses for being late" John Nichol "Point Of Impact"
|
|
|
|
|
HI all
the setup i'm working on has the debugger out of step with the code.
Working in Visual C++.net.
If i set a breakpoint and step through the debugger thinks theres code where there is clearly whitespace.
I've cleaned and rebooted and rebuilt and all that but it doesn't seem to help.
There is only one copy of the source code on the hard drive and the build times are correct for all the files
I was wondering if anyone had any suggestions as to what might be going on and any solutions that might present itself.
regards
Bryce
---
Publitor, making Pubmed easy.
http://www.sohocode.com/publitor
|
|
|
|
|
Are you debuging a DLL? I have only come across this when the DLL I was debugging was not current!?
Ant.
|
|
|
|
|
Hi
Had this problem several times and got rid of it by cleaning the project first in Visual Studio and then going to the folder and deleting manually all remaining files generated by Visual Studio.
Cheers
Peer
|
|
|
|
|
which files specifically did you delete?
obviously i need to keep the .vcproj file...what else?
regards
Bryce
---
Publitor, making Pubmed easy.
http://www.sohocode.com/publitor
|
|
|
|
|
turns out some plonker had been opening the files ona unix box
guess what that did to the linefeeds etc
Bryce
---
Publitor, making Pubmed easy.
http://www.sohocode.com/publitor
|
|
|
|
|
i am trying to enumerate the whole network using RESOURCE_GLOBALNET arguement in the WNetOpenEnum(.,.,.,.,.) function. Program is not running properly it just gives me name of the first domain it finds and then the it terminates. When i use the RESOURCE_CONTEXT arguement in the WNetOpenEnum(.,.,.,.,.) i am able to get all the machines of the particluar sub domain, in which the application is running. For test purposes i am using the following code can any one point out the problem in this code
#include <iostream.h>
#include<windows.h>
#pragma message("network library is linking with \"mpr.lib\"")
#pragma comment(lib, "mpr.lib")
BOOL GetResources(NETRESOURCE *);
int main()
{
cout<<"hello"<<endl;
="" getresources(null);
="" return="" 0;
}
bool="" getresources(netresource="" *pnetresource)
{
="" dword="" dwscope="RESOURCE_GLOBALNET;
" netresource="" *netresource="NULL;
" handle="" henum;
="" wnetopenenum(dwscope,="" null,="" null="" ,="" pnetresource,="" &henum);
="" if="" (henum)
="" {
="" count="0xFFFFFFFF;
" buffersize="2048;
" lpvoid="" buffer="new" char[2048];
="" wnetenumresource(henum,="" &count,="" buffer,="" &buffersize);
="" netresource,="" for="" (uint="" i="0;" <="" sizeof(netresource);="" i++,="" netresource++)
="" (netresource-="">dwUsage == RESOURCEUSAGE_CONTAINER && NetResource->dwType == RESOURCETYPE_ANY)
{
if (NetResource->lpRemoteName)
{
if(NetResource->dwDisplayType == RESOURCEDISPLAYTYPE_DOMAIN)
{
cout<<endl<<"domain "<<="" netresource-="">lpRemoteName;
GetResources(NetResource);
continue;
}
cout<<endl<<"machine "<<netresource-="">lpRemoteName;
GetResources(NetResource);
continue;
}
}
GetResources(NetResource);
}
}
return true;
}
|
|
|
|
|
I massaged your code a little:
bool GetResources( NETRESOURCE *pNetResource )
{
DWORD dwResult;
NETRESOURCE *NetResource = NULL;
HANDLE hEnum;
dwResult = WNetOpenEnum(RESOURCE_GLOBALNET, RESOURCETYPE_ANY, 0, pNetResource, &hEnum);
if (NO_ERROR == dwResult)
{
NETRESOURCE Buffer[750];
DWORD Count = 0xFFFFFFFF,
BufferSize;
BufferSize = sizeof(Buffer);
do
{
dwResult = WNetEnumResource(hEnum, &Count, &Buffer, &BufferSize);
if (NO_ERROR == dwResult || ERROR_MORE_DATA == dwResult)
{
for (UINT i = 0; i < Count; i++)
{
if ((Buffer[i].dwUsage & RESOURCEDISPLAYTYPE_DOMAIN) == RESOURCEDISPLAYTYPE_DOMAIN)
cout << "Domain " << Buffer[i].lpRemoteName << endl;
else if ((Buffer[i].dwUsage & RESOURCEDISPLAYTYPE_SERVER) == RESOURCEDISPLAYTYPE_SERVER)
cout << "Server " << Buffer[i].lpRemoteName << endl;
else
cout << "Machine " << Buffer[i].lpRemoteName << endl;
if ((Buffer[i].dwUsage & RESOURCEUSAGE_CONTAINER) == RESOURCEUSAGE_CONTAINER)
GetResources(&Buffer[i]);
}
}
} while (NO_ERROR == dwResult || ERROR_MORE_DATA == dwResult);
dwResult = WNetCloseEnum(hEnum);
}
return true;
}
"When I was born I was so surprised that I didn't talk for a year and a half." - Gracie Allen
|
|
|
|
|
thanks David i am able to traverse the whole network quite successfully, but there is slight problem its showing no machines rather its showing machines as servers. So where would i have to make changes to make this code perfect..
|
|
|
|