|
I have a program that disables the wireless NIC when a hard-wired network connection is detected. It works fine but there is one catch - when you want to use wireless later, you have to go to the Network Connections window and click Disable, then Enable to get it working again. People at our company just cannot remember to do this and I would really like to avoid them having to do this if possible.
The method of disabling the NIC I have used is roughly:
myMIBIFROW.dwAdminStatus = MIB_IF_ADMIN_STATUS_DOWN;<br />
dwError = SetIfEntry(&myMIBIFROW);
It works but one drawback is that the control panel Network Connections window still thinks it is enabled after this. I think this is why you have to click Disable first then Enable to get the wireless going again.
So, does anyone know how to programatically simulate a click on the Disable and Enable menu options? Any other tricks to help?
BTW - setting the status to up and calling SetIfEntry() did not work.
Thanks.
Dave
|
|
|
|
|
Sir,
I want to get some information of a cell (index of image, text etc)from a CListctrl(Report view) by giving the selected row index and column index.
Thanks in advance
Sandeep A.C
Sanc
|
|
|
|
|
use GetItem()
TCHAR tcText[MAX_PATH];
LVITEM litem;
litem.mask = LVIF_IMAGE|LVIF_TEXT;
litem.pszText = tcText;
litem.cchTextMax = MAX_PATH;
GetItem( &lviItem );
|
|
|
|
|
Might help to specify the iItem and iSubItem values as well...
Peace!
-=- James 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! DeleteFXPFiles & CheckFavorites (Please rate this post!)
|
|
|
|
|
HI,
How do we get the database into the comboboxes of domodal dialog boxes(Multiple dialog boxes).I've got it into the main dialogbox.
pls let me know
swapna_signsin
|
|
|
|
|
pass the database to dialog.
i often do in this way, create a function:
int MyDialog::MoModal(MyDatabase*pDB)
{
//p_DB is class member variable: MyDatabase*p_DB;
p_DB=pDB;
return CDialog::DoModal();
}
then you can use p_DB in any way as you like.
A special image tool for C++ programmers, don't miss it!
The world unique Software Label Maker is here for you and me ...
A nice hyper tool for optimizing your MS html-help contents.
|
|
|
|
|
i tell u, there is no such thing.
the dialog is "domodal" in same thread whatever how to call it.
A special image tool for C++ programmers, don't miss it!
The world unique Software Label Maker is here for you and me ...
A nice hyper tool for optimizing your MS html-help contents.
|
|
|
|
|
Hi
Does anyone knows if it possible to open a .txt file in main() with the usual
ifstream in1("input.txt", ios::in) written in the main() body, and then pass to a certain function or class member function a pointer pointing to the first character of the file, without having to open the "input" file from this function. If this is not possible, how can I ask the function through some argument to open itself the file? (the function should open the file even is his name is not "input", the name could maybe be given as argument?...)
Thanks
|
|
|
|
|
Do like this. Open the file using following code,
ifstream fin;<br />
fin.open("input.txt", ios::in);
now pass this fin to your function.
You should declare your function lile this,
your_function(ifstream &in, ...);
The in will contain address of fin. So you can perform file I/O operations using in
In case of any proble, let us know.
Good luck
We Believe in Excellence
www.aqueelmirza.cjb.net
|
|
|
|
|
Dear All,
How can I change views of CView type to CScrollViews?
This I dont want at runtime but at designtime.
What changes have to be made?
Do I have to change other OnDraw alogirthms too? since Here I would have to take consideration of available view window rect.
Best regards,
pathak
|
|
|
|
|
pathakr wrote: How can I change views of CView type to CScrollViews?
Modify the view's .h and .cpp files.
"Let us be thankful for the fools. But for them the rest of us could not succeed." - Mark Twain
"There is no death, only a change of worlds." - Native American Proverb
|
|
|
|
|
very easy.
1)create a new project with CScrollView as view.
2)change CView to CScrollView for old project
3)compare 2 projects to see what default functions etc you should add to old project.
anyway, backup old project first
A special image tool for C++ programmers, don't miss it!
The world unique Software Label Maker is here for you and me ...
A nice hyper tool for optimizing your MS html-help contents.
|
|
|
|
|
Hi,
I have lines places. I want to identify lines by clicking on them.
Many onLButtonDown I can scan the array of all the lines and see
whose vertex is nearer and get the line.but this may not be correct always.
How about mouse sticking in between the two vertexes, suppose I want to move the line.
Thanks
Leya
|
|
|
|
|
And what is the question exaclty ?
yang__lee wrote: but this may not be correct always.
Why ? What is the problem ? You pick the line that is closest to the point where you clicked. You can still have a maximum distance (if none of the lines is closer than a certain distance, you don't pick any of them).
yang__lee wrote: How about mouse sticking in between the two vertexes, suppose I want to move the line.
I don't understand... If the point is precisely between two line, pick one at random (it is stupid for the user to click at a point like that also )
|
|
|
|
|
Cendric,
I want dynamic effect
myline (with vertexes 1, 2, 3 which are stored in the array in the document)
1------b-------2-------------------3
\
\
\
\_\
1------b1-------2-------------------3
Now user identifies line at point b, (remember point b is between 1 and 2 and was not stored in the array. so effect should be like.. whole line moves along with mouse (rubberband effect is expected here and line should seem like it has stuck to mouse at point b) , now user keeps the line at point b1.
and line array gets updated with new points . Its a simple move line command.
But how to achive this graphical command through mfc is a question to me.
I hope , I am a bit clear to you this time.
Leya
-- modified at 8:32 Friday 21st April, 2006
|
|
|
|
|
You can use a boolean in your view class to specify if a line is being dragged or not. Then, you can also keep the data of the line being dragged: the line data plus the point on which the user has clicked. By point, I think the easiest to represent it is to hold a percentage position on the line.
Does that answer your question ?
|
|
|
|
|
But in the first place how to select the line object at the point , suggest me some alogirthm in detail.
Leya
|
|
|
|
|
Hi,
Mine is a graphic application.
When I go for printing, my graphic objects (lines rectangles etc) look
very small
as I have used the mapmode as MM_TEXT. So all of them look very small
on the printing page. I dont want to use MM_LOENGLISH as I could end
up makin huge changes in my application. How to sort this out. How to
have scalled print, preview.
Also white color elements are not displayed. so I am using (i hope its
correct)
void CMysplashView::OnPrepareDC(CDC* pDC, CPrintInfo* pInfo)
{
..
pDC->SetROP2(R2_BLACK );
..
}
thanks,
Lee
Leya
|
|
|
|
|
if u use MM_TEXT mode, u don't know printed size, because paper is in physical unit - such as mm, inch.
MM_TEXT (pixel) is not valid for paper.
set it as MM_LOENGLISH.
for a project needed to be printed, picture (text, image etc) on screen should be in MM_LOENGLISH aslo, otherwise, looking on screen is totally different from on paper.
A special image tool for C++ programmers, don't miss it!
The world unique Software Label Maker is here for you and me ...
A nice hyper tool for optimizing your MS html-help contents.
|
|
|
|
|
You can use MM_ANISOTROPIC and set the scaling factor yourself. This method allows you to even setup positive x and y axis values, mimicing MM_TEXT.
onwards and upwards...
|
|
|
|
|
I am having a listctrl (Report view ) here I added some images
m_pmyImageList->Create( 30, 15,TRUE,5,2);
CBitmap bm,bm1;
bm.LoadBitmap(IDB_BITMAP_VIEW);
int i1 = m_pmyImageList->Add( &bm,RGB(0,0,0));
bm.DeleteObject();
bm.LoadBitmap(IDB_BITMAP_TURBO);
int i2 = m_pmyImageList->Add(&bm,RGB(0,0,0));
bm.DeleteObject();
and color of selected item text is
if ( CDDS_ITEMPREPAINT == pLVCD->nmcd.dwDrawStage )
{
COLORREF crText,crBack;
if ( (pLVCD->nmcd.dwItemSpec ) ==iListPos-1 )
{
crText = RGB(255,255,255);// Selected Text color
crBack= RGB(0,0,127);/// Selection back color
}
and now the images are not getting selected. I want to make them transparent (matches with the color of selection)
How can I? Please help me .
Thanks in advance
Sandeep A.C
Sanc
|
|
|
|
|
r u trying to change the selection color of list ctrl?
the code inside the
if ( (pLVCD->nmcd.dwItemSpec ) ==iListPos-1 )
{
}
is incomplete.. can give more details...? About that code
nave
|
|
|
|
|
void CTrussListEditorView::OnCustomdrawList1 ( NMHDR* pNMHDR, LRESULT* pResult )
{
NMLVCUSTOMDRAW* pLVCD = reinterpret_cast<nmlvcustomdraw*>( pNMHDR );
// Take the default processing unless we set this to something else below.
*pResult = 0;
if ( CDDS_PREPAINT == pLVCD->nmcd.dwDrawStage )
{
*pResult = CDRF_NOTIFYITEMDRAW;
}
else if ( CDDS_ITEMPREPAINT == pLVCD->nmcd.dwDrawStage )
{
COLORREF crText,crBack;
if ( (pLVCD->nmcd.dwItemSpec ) ==iListPos-1 )
{
crText = RGB(255,255,255);// for same color use 0 instead of 255
crBack= RGB(0,0,127);
}
else
{
crText = RGB(0,0,0);
crBack= RGB(255,255,255);
}
pLVCD->clrText = crText;
pLVCD->clrTextBk = crBack;
SetBkMode(pLVCD->nmcd.hdc,TRANSPARENT);
// Tell Windows to paint the control itself.
*pResult = CDRF_DODEFAULT;
}
m_Cancel.SetFocus();
}
This is the actual function
or I just need is a transparent bold rectangle of blue color around the row to highlight the selection
Thanking you
Sandeep
Sanc
|
|
|
|
|
Its not possible to do that in this way...here u r only trying to change the background color..
I think u have to draw the item by user self if u want to achive that. CImageList have function to draw the image with blending..
nave
|
|
|
|
|
I have developed a windows shell extention to send disc files as attachments using default mail client.I have used MAPI dll's SendMail function.
It works fine for single attachment but am not able to send for multiple attachments(this problem happens only with *****LOTUS NOTES*****).Can we send multiple attachments using SendMail function?If so how(any sample code)??
I used SendDocuments to do the same with Outlook and i was able to send multiple attachments.
How do we send Multiple files as attachments in Lotus Notes using any MAPI Dll funtion?
|
|
|
|