|
I know. Unless you are logged in on the local pc as an admin on the server pc SHFileOperation will not work. Sorry.
John
|
|
|
|
|
but I am logged in as admin !!
The problem is how to tell windows that I have admin rights to the server when using the SHFileOperation function??
|
|
|
|
|
SHFileOperation uses the rights of the logged on user . Are you sure you passed the data correctly? Is your string double null terminated?
John
|
|
|
|
|
I believe there is NT documentation that claims this is not possible. I find that hard to believe.
Anyone ever found a way to create a true system environment variable, ie, not a user var or a process var, programmatically?
Thanks.
|
|
|
|
|
:(Hi there!
I have MFC app (doc/view). In that app I have a dialog with a combobox from which I want to transfer a selected item back to the main View Class where I have a VTK(Visualization toolkit) window. basically Selecting an item in the combobox should affect the object that Im displaying in my main View
when I execute my application and select the "Dialog" and select a string in the combobox it crashes and points at the member in the View class that I want to change.
Below is the code where I change a variable in the View method SetScalars.
I was wondering if it had to do with that my dialog is modal so that it cant overwrite my view class members , because that seems to be the problem.
John, that line "alot of functions and members.... " are just VTK (vizualization toolkit) stuff.
[CODE]
void CStressesDialog::OnDropDownSelchange()
{
int idx = m_DropDown.GetCurSel();
if( idx < 0 ) return;
CWnd* pParent = GetParent();
CVtkSDIView* pView = (CVtkSDIView*)pParent;
pView = (CVtkSDIView*)pParent;
CString str;
m_DropDown.GetLBText( idx,str );
pView->SetScalars(str);
}
[/CODE]
This is what causes the crash somehow this->str_select = s; where str_select is an Cstring.
[CODE]
void CVtkSDIView::SetScalars(CString s)
{
this->str_select = s;
//VTK STUFF IN THIS FUNCTION..
this->filereader->SetScalarsName(str_select);
this->filereader->Update();
this->lut->SetTableRange(this->filereader->GetOutput()->GetScalarRange());
this->lut->Build();
this->band->GenerateValues(15,this->filereader->GetOutput()->GetScalarRange());
this->band->Update();
this->pMapper->SetScalarRange(this->filereader->GetOutput()->GetScalarRange());
this->pMapper->Update();
this->renWin->Render();
this->iren->Start();
}
[/CODE]
Thanks for your help!
/regards
peter
|
|
|
|
|
what does the warning 'unreferenced local variable' mean ? how can i get rid of it ?
|
|
|
|
|
yellowtulips wrote:
what does the warning 'unreferenced local variable' mean ?
You declared a local variable which isn't referenced (You don't make any use of it)
yellowtulips wrote:
how can i get rid of it ?
Delete the declaration of the variable or use it for anything.
MS
|
|
|
|
|
|
I have a main (parent) MDI Application that launches another MDI Application. I have altered the title bar in the parent MDI App to display active security colors(all the time). When the child MDI App gets launched, especially when it's position comes up overlapping the parent App, I notice some weirdness with the mouse probably due to confusing framework messages as a result of the always active parent MDI title bar. The mouse will disappear behind the child MDI App window because it thinks it is still owned by the parent MDI App. I have tried to intercept the OnMouseActivate in the child's View class to no success. The parent title bar must stay active per requirements. Anyone know of a way I can relinquish mouse control to this child MDI App?
Thanks!
|
|
|
|
|
i have met the problem with designing a step by step program. can anyone help me with your source code or your ideal of designing a step by step program.
|
|
|
|
|
First you'll need to explain what a "step-by-step program" is.
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
|
|
|
|
|
Dear friendz....
i would like to know hoe i can change the color of the frame of a picture control placed on a dialog box when a certain event(say OnMouseMove())takes place??
all suggestionz are welcome.....
thanx in advance...
|
|
|
|
|
Hi,
I need to remove the lower combo box in a File Dialog (I mean the one which let you choose the file type). I've tried with HideControl(cmb1) where cmb1 is the ID of that combo box, but I can't hide it (the command works with the other two Combo boxes).
Notice: I'm using VS 2003.NET, the File dialog is a bit different from the old one.
Thanks
Vilmer
|
|
|
|
|
I've not tried this exact thing, but have done something similar. Derive a class from CFileDialog . At the end of the OnInitDialog() method, post a message. In the handler for that message, call ShowWindow(..., SW_HIDE) on the control you want to hide.
If you are not using MFC, you can do the same thing using GetOpenFileName() . Just specify a hook procedure in the lpfnHook member variable. In the hook procedure, handle the WM_INITDIALOG by posting the same message as mentioned before.
Hopefully this will solve your problem, or at least point you down the right path.
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
|
|
|
|
|
I usually make my windows forms by chosing the 'Windows Application Form (.Net)' , but this time i chose 'Blank Project (.Net)' instead cus i wanted to make it from scratch. I have no problem making the worms and running it.
The problem is the IntelliSense never works anymore !? How can i fix this?
Thanks in advanced!
(PS: when making forms from blank project, how can i launch the form without launching the console as well?)
|
|
|
|
|
Hello,
For the time being, in a dialog, I have a TabCtrl with several panels.
Each of its panels has a CComboBox but they all have the same content (a list of customer names).
As this content is costly to build (lot of infos extracted from a database plus the filling of the CComboBox), I would like to build this CComboBox only once (i.e. in the OnInitDialog of the dialog containing the TabCtrl) and "share" it between all panels of the TabCtrl.
By "share", I mean : the CComboBox is displayed on each panel I click and I can select from it.
I thought to create a little daughter dialog with my CComboBox, but with the create, I am obliged to give a Parent ...
Any ideas or suggestions will be appreciated.
DD
|
|
|
|
|
this might not even work, it's just an idea. how about creating the combobox as a child of the dialog, not the tab, and see if you can use SetWindowPos() or MoveWindow() , (I can't remember which one uses &wndTopMost ) without changing the size or location, just setting the the Z-order to &wndTopMost . If this doesn't work, I hope it at least gives you another idea.
If I write code in my sleep, does that make me brilliant, or just a lazy programmer?
My articles
www.stillwaterexpress.com
BlackDice - the programmer formerly known as bdiamond
|
|
|
|
|
Hello,
not bad this idea ... I already had the same ... )
look at my code hereunder :
m_Tab.InsertItem( 0, "Tabnbr1");
m_Tab.InsertItem( 1, "Tabnbr22");
m_pTab1 = new CTab1;
m_pTab1->Create(CTab1::IDD, &m_Tab);
m_pTab1->SetWindowPos(NULL, 4, 28 , 0, 0,SWP_FRAMECHANGED | SWP_NOSIZE | SWP_NOZORDER);
m_pTab1->ShowWindow(SW_SHOW);
//
m_pTab2 = new CTab2;
m_pTab2->Create(CTab2::IDD, &m_Tab);
m_pTab2->SetWindowPos(NULL, 4, 28 , 0, 0,SWP_FRAMECHANGED | SWP_NOSIZE | SWP_NOZORDER);
m_pTab2->ShowWindow(SW_HIDE);
//
m_pDialogListe = new CTestDialogListe;
m_pDialogListe->Create(CTestDialogListe::IDD, &m_Tab); // solution1
m_pDialogListe->Create(CTestDialogListe::IDD, (CWnd*) m_pTab1); // solution2
m_pDialogListe->Create(CTestDialogListe::IDD, NULL);
m_pDialogListe->SetWindowPos(NULL, 4, 28 , 0, 0,SWP_FRAMECHANGED | SWP_NOSIZE | SWP_NOZORDER);
m_pDialogListe->ShowWindow(SW_SHOW);
As you can see, when we create the doughter dialog with the combo box in, we are obliged to give a parent.
If I give the Tab (solution1) as parent : ok, the combo is displayed on every panels, but is not accessable from any of the 2 panels.
If I give the panel1 (solution2) as parent : ok, the combo is displayed on panel1 and it works, but is even not displayed on panel 2. Is there a solution to make it appear and make it work on panel 2?
Thanks your your answer
DD
|
|
|
|
|
Each panel should have its own combobox. If the populating of the combobox is expensive (e.g., querying a database), you can put the data (e.g., list) in the dialog instead. Then as each panel is activated, the data can be quickly pulled from the dialog's data structure rather than from an external source. Make sense?
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
|
|
|
|
|
Hello,
<each panel="" should="" have="" its="" own="" combobox="">
that's what all my trials seem to proove ... (
<you can="" put="" the="" data="" (e.g.,="" list)="" in="" dialog="" instead="">
what do you mean by "in the dialog instead" ?
the dialog with the tab is not permanent, there is a general menu above that calls this dialog-Tab when I need it, and when I return to general menu, all this stuff is destroyed.
Effectively, maybe I should make the extraction from DB once at the launch of the application, save the result in a global list, and fill every combos from this list. Remain the problem to synchonize this list with the DB ...
Why not ... if I don't find another solution
Thanks
DD
|
|
|
|
|
qadddd_free wrote:
what do you mean by "in the dialog instead" ?
I assumed that the parent/owner window of the tab control was a dialog.
qadddd_free wrote:
Remain the problem to synchonize this list with the DB ...
If you are just reading from the database, what needs to be synchronized?
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
|
|
|
|
|
hello,
It is the case
<if you="" are="" just="" reading="" from="" the="" database,="" what="" needs="" to="" be="" synchronized?="">
I am reading from the database but this application is planned to be used by several users able to change the content of the tables I am reading, so I have to synchronize my list with eventual new records or with record content that have been changed
Regards
DD
|
|
|
|
|
Then you are obviously going to have to requery the database each time. That is the only way to get updated records.
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
|
|
|
|
|
Disable network.
A com solution
<br />
#define _WIN32_WINNT 0x0502<br />
<br />
#include <windows.h><br />
#include <stdio.h><br />
#include <objbase.h><br />
#include <netcon.h><br />
<br />
#define CheckHR(info) \<br />
{ \<br />
HRESULT hr = (info); \<br />
if(FAILED(hr)) \<br />
{ \<br />
if ( hr != 0x800704D5 ) \<br />
{ \<br />
printf("ERROR"); \<br />
exit(1); \<br />
} \<br />
}\<br />
}<br />
<br />
<br />
typedef enum<br />
{<br />
DISABLE = 0,
ENABLE = 1,
PORT_STATUS = 2,
LINK_STATUS = 3,
ENDIS_PORT = 4
}PORTSTATUS;<br />
<br />
<br />
<br />
void main(int argc, char** argv)<br />
{<br />
INetConnectionManager* pManager;<br />
INetConnection* pConnection;<br />
IEnumNetConnection* pEnum;<br />
INetConnectionConnectUi* pConnectionUI;<br />
<br />
ULONG celtFetched;<br />
<br />
BOOL bFoundInterface = FALSE;<br />
int nPortStatus = -1;<br />
int nCmd = -1;<br />
wchar_t ifname[100];<br />
<br />
<br />
if (argc <= 2 )<br />
{<br />
printf("ERROR");<br />
return;<br />
}<br />
<br />
swprintf(ifname,L"%S",argv[1]);
nCmd = atoi(argv[2]);
if ( argc == 4 )<br />
{<br />
nPortStatus = ( argv[3][0] == '1' ) ? 1:0 ;
}<br />
<br />
<br />
CheckHR( CoInitialize(NULL) );<br />
CheckHR( CoCreateInstance(CLSID_ConnectionManager, NULL, CLSCTX_SERVER, IID_INetConnectionManager, (void**)&pManager) );<br />
CheckHR( pManager->EnumConnections(NCME_DEFAULT, &pEnum) );<br />
pManager->Release();<br />
<br />
while( pEnum->Next(1, &pConnection, &celtFetched) == S_OK )<br />
{<br />
NETCON_PROPERTIES* properties;<br />
CheckHR( pConnection->GetProperties(&properties) );<br />
if ( (wcscmp(properties->pszwName,ifname)) == 0 )<br />
{<br />
bFoundInterface = TRUE;<br />
switch(nCmd)<br />
{<br />
case PORT_STATUS:<br />
case LINK_STATUS:<br />
{<br />
switch(properties->Status)<br />
{<br />
case NCS_DISCONNECTED:<br />
case NCS_DISCONNECTING:<br />
case NCS_HARDWARE_NOT_PRESENT:<br />
case NCS_HARDWARE_DISABLED:<br />
case NCS_HARDWARE_MALFUNCTION:<br />
case NCS_AUTHENTICATION_FAILED:<br />
case NCS_INVALID_ADDRESS:<br />
case NCS_CREDENTIALS_REQUIRED:<br />
printf("Port is not Functioning");<br />
break;<br />
case NCS_CONNECTED:<br />
{<br />
if ( nCmd == PORT_STATUS )<br />
printf("Port is UP");<br />
else<br />
printf("Link is UP");<br />
}<br />
break;<br />
case NCS_MEDIA_DISCONNECTED:<br />
printf("MEDIADISCONNECTED");<br />
break;<br />
default:<br />
printf("ERROR");<br />
break;<br />
}<br />
}<br />
break;<br />
case ENDIS_PORT:<br />
{<br />
switch(nPortStatus)<br />
{<br />
case DISABLE:<br />
{<br />
if(SUCCEEDED(pConnection->QueryInterface(IID_INetConnectionConnectUi, (void**)pConnectionUI)))<br />
{<br />
pConnectionUI->SetConnection(pConnection);<br />
pConnectionUI->Disconnect(NULL, NCUC_NO_UI);<br />
pConnectionUI->Release();<br />
}<br />
else<br />
{<br />
CheckHR( pConnection->Disconnect() );<br />
}<br />
}<br />
break;<br />
case ENABLE:<br />
{<br />
if(SUCCEEDED(pConnection->QueryInterface(IID_INetConnectionConnectUi, (void**)pConnectionUI)))<br />
{<br />
pConnectionUI->SetConnection(pConnection);<br />
pConnectionUI->Connect(NULL, NCUC_NO_UI);<br />
pConnectionUI->Release();<br />
}<br />
else<br />
{<br />
CheckHR( pConnection->Connect() );<br />
}<br />
}<br />
break;<br />
default:<br />
printf("ERROR");<br />
break;<br />
}<br />
}<br />
break;<br />
default:<br />
printf("ERROR");<br />
break;<br />
}<br />
CoTaskMemFree(properties);<br />
pConnection->Release();<br />
break;<br />
}<br />
else<br />
{<br />
CoTaskMemFree(properties);<br />
pConnection->Release();<br />
continue;<br />
}<br />
}<br />
if ( !bFoundInterface )<br />
printf("ERROR");<br />
<br />
pEnum->Release();<br />
CoUninitialize();<br />
}<br />
<br />
There is no spoon.
mail
|
|
|
|
|
How to create Device Driver for win 2000.This driver must support all peripheral devices.
|
|
|
|
|