|
hiho
i'm using a visual c++ .net setup project to install my software
the problem is that the installation can only be done my an administrator because it writes in the c:\program files\... directory
so i want that if the user installs my prog, the radio button for 'install for actual user' is set to 'install for all users'
because if the user installs my app with admin rights, it only installs for current user (if the user doesn't check the radio button to all users)
and the current user is the admin
is there a setting in the setup project, where i can change the pre-definition for the radio button?
i've not found one
and is there a way to automatically deinstall the software if it is already installed, before newly installation
because my setup aborts if the software is already installed
thx
|
|
|
|
|
Hello,
After reading "Modern C++ design" by "Andrei Alexandrescu", I wanted to use the Loiki library. I can't get the library to compile under VC++ 6.0, but it works like a charm on Visual Studio 2005.. I was wondering, does VS6.0 support the template stuff used in the loki library?
Thanks.
I also got the blogging virus..[^]
|
|
|
|
|
how can i connect in to a database without specifying the DSN name in the connection string ?, i heard some string with the combination of SERVER ; DATABASE and DRIVER can do that ! i tried but i couldnt.. any idea?
thanks in advance
Situation : my program uses SQL server as database( local / remote ). user can add multiple companies( each company creates as seperate database), and i connects them via DSN , the problem is the DSN is creating in local machine. but the company details keeps in remote machine, any user connects to the remote machine can view the companies but he couldnot connect to that bcz the DSN resides in local machine from where the company was creted.
if there is any machanism to represent the DSN detailes in remote machine ( Table entries), i can connect into companies by using those info without depending the local DSN
Ninety-eight percent of the thrill comes from knowing that the thing you designed works, and works almost the way you expected it would. If that happens, part of you is in that machine.
|
|
|
|
|
Try this search.
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
|
|
|
|
|
Hello Friends,
Please obeserve the cpp program given below
#include <iostream.h>
int main(void)
{
register int i = 10;
cout <<"the address of i" << &i << endl;
cout <<"the value of i is " << i << endl;
return 0;
}
The output of the program is given below
the address of is 0x0012FF7C
the value of i is 10
The same program is written in C and the program is given below
#include <stdio.h>
int main(void)
{
register int i = 3 ;
printf ("the address of i %u", &i);
printf ("the value of i %d" , i);
return 0;
}
The program show an error which is given below
compiling...
register_c.c
D:\c++\registe_test\register_c.c(7) : error C2103: '&' on register variable
Error executing cl.exe.
register_c.obj - 1 error(s), 0 warning(s)
My question is what is the difference in the use of register variable is c and cpp program.I am able to get the address of register variable in cpp using the "&i". The same technique is not allowed in c program .
Can anyone tell what is the reason this is happening.
Hoping for a reply.
Best Regards,
Phijo Philip.
|
|
|
|
|
From MSDN entry on "register Keyword"
[quote]
ANSI C does not allow for taking the address of a register object; this restriction does not apply to C++. However, if the address-of operator (&) is used on an object, the compiler must put the object in a location for which an address can be represented. In practice, this means in memory instead of in a register.
[/quote]
"You're obviously a superstar." - Christian Graus about me - 12 Feb '03
"Obviously ??? You're definitely a superstar!!!" mYkel - 21 Jun '04
Within you lies the power for good - Use it! Honoured as one of The Most Helpful Members of 2004
|
|
|
|
|
Another point you should remember is that the compiler may choose to ignore your "register" keyword, i.e. it treats
register int i = 3 ;
as a request to make i a register variable. The compiler may decide to make it a memory variable instead. And it will not tell you if it decides to ignore your "register" request.
|
|
|
|
|
Hello,
I have a difficulty regarding my project. I want to set or reset the data pins on parallel port 'lpt1'.Is there is any function to do this?
Also I want to monitor the printer port like, what is the status of it,i.e. which data pins are set and which are reset and then I want to store these values in a database to take further action.
Rohit Deshpande-
atotalgeek@gmail.com
|
|
|
|
|
The parallel port is accessed through I/O calls. The lpt1 address is usually 0x378 (data), 0x379 (status), 0x37a (control). You can use these assembly functions to write and read the port:
inline char inportb(short port)
{
char rtn;
__asm {
mov dx, port
in al,dx
mov rtn, al
}
return rtn;
}
inline void outportb(short port, char data)
{
__asm {
mov al, data
mov dx, port
out dx, al
}
}
But keep in mind that "in" and "out" are priviledged instructions and will cause an exception on NT/2000/XP. To use them you'll need to grant the process special priviledges using an installed service or similar. If you can't find info on that I may be able to dig up my old code.
Do some google searches on the above and it should answer most of your questions. I also recommend the book "Parallel Port Complete" by Jan Axelson. I used it extensively years ago and it is indeed complete
Nicholas
|
|
|
|
|
Thanks Nicholas,
Well I will definately do some google searches for that special priviledges.But do you have some code written in C++ so that i can easily implement it in VC++?
And also help regarding monitoring the lpt1.
Rohit Deshpande-
atotalgeek@gmail.com
|
|
|
|
|
Hi again-
Regarding monitoring you'll need to use the 'status' IO address. Some ports also are bi-directional and you can read the data on the D0-D7 pins using the data IO address. Read up on all these things to learn more. It's all out there...
Regarding giving your program IO access, here's a solution that should work for you. My solution was implemented the same way:
http://pages.zoom.co.uk/andyc/ntdriver.htm
Good luck,
Nicholas
|
|
|
|
|
|
u will also find the function outportb() and inportb(); a useful one for thiz(just mention the port name "0x378" and the databyte to be sent/to be recieved.....
as said before u can use thiz for the control and status port as well.....
cheerz.....
"faith, hope, love remain, these three.....; but the greatest of these is love" -1 Corinthians 13:13
|
|
|
|
|
Hi, there. It really depends on what kind of interaction you need. If you are using the standard printer protocols like Nibble mode or EPP mode etc, you should use the WIN32 API to read/write from the port. Or if u want to access the raw port registers directly, one good free source is the one provided by beyondlogic. Just google for it , its called INPOUT32.DLL.It has a driver that allows direct access to the parallel port. I hope this will help you.
there's no such thing as a stupid programmer...
|
|
|
|
|
It's a stupid question, I know, but anyway..
Suppose, I have some MDI application with a modeless property sheet. In one of the property pages classes (CInput: public CPropertyPage) I have a public function AddEditBox() (which creates and displays Edit Boxes). I want to call that function on some event, which I handlе in my View class.. what shoul I do?
|
|
|
|
|
Obtain pointer to that property page and call function using it making sure this page is an active one.
If you gave more details as where property sheet exists I could give you a hint on how to obtain that pointer.
JohnCz
|
|
|
|
|
Please, tell me, what's wrong here:
class CInput : public CPropertyPage<br />
{...<br />
void AddEditBox();<br />
...<br />
}<br />
<br />
<br />
void CInput::AddEditBox()<br />
{<br />
<br />
CRect rect( 8, 25, 28, 45 );<br />
int ID = 4000;<br />
<br />
CEdit *p = new CEdit;<br />
<br />
p->Create( WS_CHILD | WS_VISIBLE | WS_TABSTOP |<br />
ES_AUTOHSCROLL | WS_BORDER | WS_DISABLED, rect, this, ID );<br />
<br />
}
Now, I want to call this function from my View class (on WM_LBUTTONUP event)
void CMyView::OnLButtonUp(UINT nFlags, CPoint point) <br />
{<br />
...<br />
CInput inp;<br />
...<br />
inp.AddInputEdit();<br />
...<br />
}
but Create function returns 0..? why? what I did wrong..?
|
|
|
|
|
It imperative that if you post code post all relevant parts.
You are instantiating object of the CInput type.
Your . . . do not allow me to see if you call Create member of the page. Therefore the first thing is that raises question is that you are calling member function (AddInputEdit) that requires valid window handle.
Even if you were successful creating edit control, this page is not a part of property sheet anyway and on the top of it will be destroyed when OnLButtonUp goes out of scope.
You have to obtain pointer to existing page, make sure that window is attached to it and then call AddInputEdit.
Page has no window attaché until is activated.
JohnCz
|
|
|
|
|
Thanks a lot! I've fixed the error like You told me and now everything works properly and I'm very happy about that
|
|
|
|
|
hi guys
i need help on this real bad....
i posted this messege earlier but didnt solve the problem .. will someone plese respond to this .. please...........
I have a MFC application dialog based.. has 2 dialog forms say dialog1 and dialog 2.. in dialog1 i have a picture holder (IDC_HOLDER). what i need to do is get the "Rect" value of that holder from dialog2 .. i can do that from dialog1 with
CRect rc;
GetDlgItem(IDC_HOLDER)->GetWindowRect(rc);
but how to access that from dialog2....
i tried
CDialog1* dlg;<br />
dlg->GetDlgItem(IDC_HOLDER)->GetWindowRect(rc);
doesnot work...
my whole project has come to HALT by this ... please help .. someone !!!!!
thanks
zm
where are all the GURUS???
|
|
|
|
|
|
Does dialog1 open dialog2? If it does, try the following:
1. Give dialog2 a member variable - HWND m_hWnd1;
2. Before dialog1 opens dialog2 use - dialog2.m_hWnd1 = m_hWnd;
Then use:
RECT r;
::GetWindowRect(::GetDlgItem(m_hWnd1, IDC_HOLDER), &r);
|
|
|
|
|
Admission of guilt
This is a shameless ploy to get my fellow CPians help this sleep deprived developer meet yet another (self-imposed) insanely aggressive deadline.
Anyone care to provide the implementation of (or a pointer to) this word wrap method?
void wordWrap
(CString strText,
int nWrap,
CPtrArray& lines);
Example:
CString strText = "The quick brown fox jumps over the lazy dog";
CPtrArray lines;
wordWrap (strText, 17, lines);
ASSERT (lines.GetSize() == 3);
ASSERT (lines[0] == "The quick brown");
ASSERT (lines[1] == "fox jumps over");
ASSERT (lines[2] == "the lazy dog");
Many thanks!
/ravi
My new year's resolution: 2048 x 1536
Home | Articles | Freeware | Music
ravib@ravib.com
|
|
|
|
|
Best I can do on short notice is this article[^].
Two problems with it.
1) It's in VB, so some translation is needed
2) It pads lines with spaces, so some truncation is needed
I would guess that doing those two is less effort than developing it from scratch!
|
|
|
|
|
Thanks, Graham! I'd come across that one as well as a couple of implementations in Java. PJ Arends rose to the occasion and (not surprisingly) crafted a great solution.
/ravi
My new year's resolution: 2048 x 1536
Home | Articles | Freeware | Music
ravib@ravib.com
|
|
|
|