|
http://www.codeproject.com/Questions/111260/VS-NET-2008-hangs-everytime-we-load-our-project-fr.aspx?tab=mostrecent
UPDATING SOURCE CONTROL STATUS
YaY! YOU FRIGGIN ROCK! Thank you so much! You dont know how bad this was affecting my work!
Because you helped me so much, I'm gonna return the favor and help those who dont know how to update the hosts file.
We have Visual Source Safe 2006 and Visual Studio 2008.
Our VSS database is on a network drive.
Step 1 - Determine which server\computer the VSS Database is on:
In Visual Studio 2008 select File->Source Control->Change Source Control. Note the "Server Name". You're only interested in the server name which is the value between the beginning back slashes and the next backslash. In my case it is dddmisfile
\\dddmisfile\vssdatabase\FocusDD
Step 2 - Determine the ip address of the server: Open a Command Prompt (start->Run type cmd and press enter) and ping your server name (type ping YOURSERVERNAME in the command prompt box). I typed ping dddmisfile and this is what I got:
c:\>ping dddmisfile
Pinging dddmisfile.azdes.gov [10.104.49.10] with 32 bytes of data:
Reply from 10.104.49.10: bytes=32 time=-52ms TTL=128
Reply from 10.104.49.10: bytes=32 time=-52ms TTL=128
Reply from 10.104.49.10: bytes=32 time<1ms TTL=128
Reply from 10.104.49.10: bytes=32 time<1ms TTL=128
Ping statistics for 10.104.49.10:
Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),
Approximate round trip times in milli-seconds:
Minimum = 0ms, Maximum = -52ms, Average = 1073741798ms
The IP Address you are interested in is the one that follows Reply from
In My case its 10.104.49.10
You're also interested in the fully qualified domain name: which is the name of the server with the domain appended to it. In My case its dddmisfile.azdes.gov
Step 3 - Add a line to your hosts file with any text editor Open the file with notepad. Type this in the run box (Start->Run)
C:\WINDOWS\NOTEPAD.EXE C:\WINDOWS\SYSTEM32\DRIVERS\etc\HOSTS
This is what I see before I modify it:
# Copyright (c) 1993-1999 Microsoft Corp.
#
# This is a sample HOSTS file used by Microsoft TCP/IP for Windows.
#
# This file contains the mappings of IP addresses to host names. Each
# entry should be kept on an individual line. The IP address should
# be placed in the first column followed by the corresponding host name.
# The IP address and the host name should be separated by at least one
# space.
#
# Additionally, comments (such as these) may be inserted on individual
# lines or following the machine name denoted by a '#' symbol.
#
# For example:
#
# 102.54.94.97 rhino.acme.com # source server
# 38.25.63.10 x.acme.com # x client host
127.0.0.1 localhost
To add your server name to this list, simply add a new line and type the ip address then press tab then the fully qualified domain name:
10.104.49.10 dddmisfile.azdes.gov
Thats it! Close Notepad and you're done! Dont even need to reboot!
Dont for get to save your changes!
|
|
|
|
|
Hi all,
Actually, i want to read a ".reg" file and to write it values accordingly in a list control. Now my problem is i m not getting how to read this file. Is there any way to read this file...
|
|
|
|
|
neha.agarwal27 wrote: i m not getting how to read this file.
What is going wrong?
Show your code so far, please. And the errors you get.
A .reg-file is in every respect a normal text-file. It has a certain format. So you would need to write a (medium-complicated) parser.
Let's think the unthinkable, let's do the undoable, let's prepare to grapple with the ineffable itself, and see if we may not eff it after all. Douglas Adams, "Dirk Gently's Holistic Detective Agency"
|
|
|
|
|
CString str;
CStdioFile ptr;
ptr.Open("C:\\Documents and Settings\\Mac01\\My Documents\\web.reg",CFile::modeRead,NULL);
ptr.ReadString(str);
while(str != "")
{
AfxMessageBox(str);
ptr.ReadString(str);
}
ptr.Close();
I am using this code to read my .reg file. It has various values inside it, but output is "ypW".
|
|
|
|
|
What is the third param of CStdIoFile-c'tor?
My MSDN only shows two parameters there: filename and flags.
Other than that, I don't see what is wrong with your code.
This console-program uses std C++ streams instead as MFC, but it works as intended:
#include "stdafx.h"
#undef max //even out some MFC-idiocity
#undef min
#include "iostream"
#include "fstream"
#include "limits"
int _tmain(int argc, _TCHAR* argv[])
{
std::string str;
std::ifstream ptr;
ptr.open("C:\\Documents and Settings\\Mac01\\My Documents\\web.reg");
if( ptr.is_open()) {
std::getline( ptr, str);
while( ptr){
std::cout << str << std::endl;
std::getline( ptr, str);
}
}
else {
std::cout << "Unable to open file!" << std::endl;
}
return ::system( "pause");
} The harder part is interpreting the lines you read.
In '[' and ']' you find the name of the Registry to open, and below that you find key/value-pairs of keys to set.
Let's think the unthinkable, let's do the undoable, let's prepare to grapple with the ineffable itself, and see if we may not eff it after all. Douglas Adams, "Dirk Gently's Holistic Detective Agency"
|
|
|
|
|
Your .reg file is most likely in Unicode (UTF-16) format. You have to open the file with the CFile::modeBinary flag.
Also, you may have to create a Unicode project to display the contents of the file properly.
|
|
|
|
|
Michael Schubert wrote: Your .reg file is most likely in Unicode (UTF-16) format.
Such thing is possible?!?
OK, sure. How could it handle non-latin content otherwise?
Let's think the unthinkable, let's do the undoable, let's prepare to grapple with the ineffable itself, and see if we may not eff it after all. Douglas Adams, "Dirk Gently's Holistic Detective Agency"
|
|
|
|
|
There are several possibilities: UTF-8, ISO or Windows encodings, single or multibyte to represent non-latin characters.
However, Microsoft changed the default registry export format to Unicode from Windows 2000 onwards (which is a good thing).
|
|
|
|
|
U'r code won't work at all. If u see the .reg file closely, its actually an .inf/.ini file format. So u can implement the same concept/logic of .ini/.inf here.
Come online at:-
jubinc@skype
|
|
|
|
|
how do i get the default value of a check box into another form?
for example i have 2 check boxes in a form. if i click on any of the check boxes the value is getting passed. but what do i do to make the application fetch the value without clicking the checkboxes. or without opening that form?
|
|
|
|
|
Do you have tried already a simple GetWindowText?
Greetz
|
|
|
|
|
how can i use a GetWindowText function for this? i am not accessing the form for that. the default value needs to be set once i click on the first menu item of the screen.
|
|
|
|
|
You can set the value of the control via SetWindowText
This way:
CString val = "My Default";
MyComboBox.SetWindowText(val);
if you do this from another view, you need to have a pointer to the view where you want to change the value
In the view you create a small funtion which gets a CString and puts it into the control
void FirsteView::SetValueToComboBox(CString val)
{
MyComboBox.SetWindowText(val);
}
you call it naturally this way:
void SecondView::Test()
{
PointerToFirstView->SetValueToComboBox("lalalaa");
}
Via a Menu-Item it's the same way. You call into the menu-item-handler the SetValueToComboBox Function of the other view
I saw my error, i was doing the traitement for Combobox, not for Checkbox! SORRY
But the accessing to the control is the same, but Get/SetWindowText is totally bullshit
It's monday morning
|
|
|
|
|
What has to do GetWindowText with check box state?
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
[my articles]
|
|
|
|
|
Woupssss
Confused Combobox with Checkbox
Thanks for notation
|
|
|
|
|
|
workaround...???
any leads? please... dying to figure out this for the last couple of days. i have actually used GetCheck function to get the current value of the checkbox. that i am getting correctly. second part i am stuck..
|
|
|
|
|
Chandrasekharanp wrote: workaround...???
Yes, you have to store the check box status inside variables and access the latter. If you need to access the check status even when the form does not exists, then you have to make that variables persistent.
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
[my articles]
|
|
|
|
|
that was a killer and went over my head... can u explain in a simpler way?
|
|
|
|
|
The form can store on a file the status of its check boxes, hence making them available (via file reading) even when the application is not alive.
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
[my articles]
|
|
|
|
|
ok... i can certainly try that..
now another thing that i need to solve is that when i click on a checkbox. for ex: "changing the state to 0" will the value be the same when i come back again to the same screen or will it get reset? i am aware of the fact that i cant use OnOK() with formview class. so what can be done to store the state of the checkbox. if it resets what are the options to keep the checkbox alive thou the screen is not used?
i hope u understood my problem
|
|
|
|
|
I guess we're talking about MFC . Why don't you map the check box control (i.e. the CButton) to a form variable member? This way you can access the member variables even when the form is no more visible (is no more a Window).
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
[my articles]
|
|
|
|
|
i know i am asking u too much... but i am forced to... will u be able to give me an example??
|
|
|
|
|
Well, it is not difficult:
Open the resource editor and select the dialog corrensponding to you FormView then select one of the check boxes, click the right mouse button and finally choose Add Variable item in the newly appeared context menu.
On the appeared dialog, choose the Value item of the Category list box, give a meaningful name to the variable and finally click the Finish button.
The new created variable will reflect the checkbox state content each time you call UpdateData and will maintain that value even when the FormView will be no more visible.
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
[my articles]
|
|
|
|
|
i have done all this. now one thing that i need to know is, this has to been put in on InitialUpdate Function or OnDraw function?
|
|
|
|