|
Ahsan Askare wrote: I want to display each line number in the source code editor of the IDE.
Maybe it's a language barrier thing, but the line numbers I mentioned are shown in the editor. They are, however, not on the left of the code which I think is what you are after.
Ahsan Askare wrote: Just like to know whether it is possible with VC++ 6.0
This functionality does not exist with VC++ v6.
"Take only what you need and leave the land as you found it." - Native American Proverb
|
|
|
|
|
|
From MSDN:
When specifying an explicit RGB color, the COLORREF value has the following hexadecimal form:
<code>0x00bbggrr </code>
The low-order byte contains a value for the relative intensity of red; the second byte contains a value for green;
and the third byte contains a value for blue. The high-order byte must be zero. The maximum value for a single byte is 0xFF.
So just use masks to retrieve the colors:
COLORREF Color = ....;<br />
int BlueValue = Color&0x00FF0000;<br />
int GreenValue = Color&0x0000FF00;<br />
int RedValue = Color&0x000000FF;<br />
<br />
|
|
|
|
|
or use the GetRValue , GetGValue , GetBValue functions.
Maximilien Lincourt
Your Head A Splode - Strong Bad
|
|
|
|
|
True, because I just realized my version was completely bugged . It works well for the red component but for this other ones, the bits needs to be shifted...
|
|
|
|
|
Cedric Moonen wrote: True, because I just realized my version was completely bugged
yeah, you forgot the shifts...
int BlueValue = Color&0x00FF0000 >> 16;
int GreenValue = Color&0x0000FF00 >> 8;
int RedValue = Color&0x000000FF;
TOXCCT >>> GEII power [toxcct][VisualCalc 2.20]
|
|
|
|
|
oki, but how can I use the GetRValue, GetGValue, GetBValue functions to display the colorref value in a messagebox or an editbox? an example code?
thanks alot
|
|
|
|
|
Just use printf:
char szText[255];<br />
printf(szText,"Red value: %i, Blue value: %i, Green value: %i",GetRValue(...),GetBValue(...),GetGValue(...));
Of course, you have to replace the ... by your COLORREF variable
|
|
|
|
|
|
For the first one, just use COLORREF GetColour(); from the control.
Dude, when you use classes from an article here, first read how to use it (and there is also example source code with the article). If we don't use this control, we don't know how to use. It just took me 30 seconds looking at the text of the article to find how to use it.
|
|
|
|
|
don't call me a dude, and I read before I ask, and if it is bothering you then don't answer at all, I don't need your answer, got it dude?
|
|
|
|
|
hi!
Noone answerd my question last time so ill try again:
I have a problem with my directsound application.Every time i play my sound and if there is another application playing(e.g windows media player) i get corupted sound.My cooperative level is DSSCL_PRIORITY. I also have problem when trying to create DirecSound object with CoCreateInstance metod(always fails).
If anyone has some experience with this problem or if you can direct me to some good article i would be very grateful
Many thanks!
|
|
|
|
|
I have service application which has to launch an application in the context of the current interactive user. If there is not interactive user, then the application will not be started.
I tried using CreateProcessAsUser, but then I need to have a token to that user's session. How do I get that?
Thanks!
|
|
|
|
|
Hi,
Try LogOnUser function to get the token.
Bye,
Cool Ju
Dream Ur Destiny
|
|
|
|
|
Cool Ju wrote: Try LogOnUser function to get the token
I need to run my app on the same session as the current interactive session. LogonUser will create a different session. Furthermore, how do I get to know the username, etc.....
I want to achieve something of the sort that DCOM does. For DCOM servers, we have the option to specify to launch it in the interactive user's session. Similar kind of thing is what I am looking for...
|
|
|
|
|
I need to add some files from the
other directory then my existing project
directory .
The files are header files and are located
on diffent drive.
Insted of changing all the path can i give
a path in Project>Setting , ???
Vikas Amin
Embin Technology
Bombay
vikas.amin@embin.com
|
|
|
|
|
Yep, sure. Depends on which IDE you use. For 2005, you go in the project properties -> c/c++ -> general -> additional include directories. It is almost the same for VC6 (except that is not displayed the same way).
|
|
|
|
|
In VC6, you will find it here:
Goto Project->Settings->C/C++->Preprocessor.
Put them in "Additional include directories:"
If you want more than one, separate the with commas.
|
|
|
|
|
Hi All,
This is my second post regarding the problem.i haven't got its solution yet.
I am using access automation. Please Guide How can I Get number of tables & names in a database using access automation?
I just want to figure out number of tables & table names in an access database.is it possible using access automation.How?
i don't know if it is possible using database connectivity since i don't intend to do anything with data or data fields in the tables.
I am using vc++ 6.0,access-2000.
Please Help!!
Regards,
Ankush Mehta
Ankush Mehta
|
|
|
|
|
Hello.
I feel I must respond, since noone else does.
I'm not in any way DB expert, but I have a faint memory that a real expert once told me that all table and column names are stored in a special "system" DB table.
I'm not sure if this is true for all DB's, but it might me worth investigating.
Good luck.
Kakan
|
|
|
|
|
Ankush Mehta wrote: This is my second post regarding the problem.i haven't got its solution yet.
No wonder about it. Your problem statement is not clear.
Ankush Mehta wrote: don't know if it is possible using database connectivity
If you do not connect to the database, how do you plan to get information about the database?
Ankush Mehta wrote: How can I Get number of tables
//No. of tables.
CDaoDatabase::GetTableDefCount();
//Information about tables, including table names
CDaoDatabase::GetTableDefInfo();
Regards,
Rajesh R. Subramanian
You have an apple and me too. We exchange those and We have an apple each.
You have an idea and me too. We exchange those and We have two ideas each.
|
|
|
|
|
Thanks Rajesh,
i was just trying to use access automation(functionality provided by access to manipulate access without making any connection) to achieve that.However, couldn't find an answer to that.
Thanks,
Ankush Mehta
Ankush Mehta
|
|
|
|
|
Hi All,
// Build the SQL statement
SqlString = "SELECT Name FROM MsysObjects where type = 1 AND (Left([Name],4) <> \"Msys\") AND (Left([Name],1) <> \"~\")";
// Execute the query
recset.Open(CRecordset::forwardOnly,SqlString,CRecordset::readOnly);
I have found this piece of info. MsysObjects table contain all the info about tables, queries,reports in access database.
when i try to query MsysObjects table "Access is denied". I don't know where is it located & also it is undocumented. How can i query MsysObjects table?
Please Help!
Regards,
Ankush Mehta
Ankush Mehta
|
|
|
|
|
I am working with MFC to read the file system and populate all directories, subdirectories and files in a tree. I am using a recursive function to do it. When this function finds a directory, it calls itself for searching that directory for its inner directories and files. I included objects of HTREEITEM as root and TVINSERTITEM as tvInsert in CFileSysDlg.
I wrote following code to populate the tree
int CFileSysDlg::FindFiles(HANDLE fp, unsigned long ino, unsigned long itable_blkno)<br />
{<br />
HTREEITEM newitem = root;
if (file_type == 2)
{<br />
tvInsert.hParent = root; <br />
tvInsert.hInsertAfter = NULL;<br />
tvInsert.item.mask = TVIF_TEXT;
tvInsert.item.pszText = (LPSTR)file_name;<br />
newitem = pCtrl->InsertItem(&tvInsert);<br />
FindFiles(fp, inodeno, itable_blkno); <br />
}<br />
else<br />
{<br />
if (file_type == 1)
{<br />
hPA = pCtrl->InsertItem(TVIF_TEXT,(LPSTR)file_name, 0, 0, 0, 0, 0,newitem, NULL);<br />
}<br />
}<br />
}
Problem is that it shows me directories and subdirectories at the same level.
Please tell me how can i correct it. Please reply me as soon as possible
Thanks
We Believe in Excellence
-- modified at 5:39 Thursday 1st December, 2005
|
|
|
|
|
Hello Auueel.
The standard way to solve this problem is to use a variable which holds an "indent level number".
For every directory found, increment the "indent level number" variable. For every directory you back out of, decrement the "indent level number" variable.
Then use the "indent level number" variable when you display an item.
Kakan
|
|
|
|