I have a text file.
I read each line with sr.readline();
as i read that line, i want to search for it in a List that it should have been added to previously, then add it to a NEW list. How do i do this?
I'm using ddkbuild for building my driver.
And I use prefast also.
Prefast has /StackHogThreshold option.
The default value is 1024 Bytes.
But I can't modify the value.
It's my input for 'Rebuild All Command Line'
C:\Windows\System32\cmd.exe /k "$(SolutionDir)....\ddkbuild.bat" -WIN7WLHA64 -prefast free $(ProjectDir) -cZ
I have a link. I have checked that the link is a valid URL through regular expressions. Now, I want to check if the link is a valid http link or not. i.e. it should not be a non-existing link.
Is there a way in VC++ 6.0 (MFC) to check that?
Hi,
I've been trying to debug an existing asp.net web application that requires me to debug against an IIS website.
I've installed the app and can navigate to it on localhost. However, when I start VS 2008 as an Administrator and try to debug it, I get a message "Unable to start debugging on the web server. The IIS worker process for the launched URL is not currently running."
I've looked through some of the help file contents and can't seem to figure out what is going on. Clearly, the IIS worker process IS running, since I can navigate to the site locally without VS open.
My boss has suggested that it might be because my OS is 64 bit. Any ideas?
Hi i a have created a global.h file in which i define enum Token
I get the garbage value of token if i use the value of Token other than glabal.cpp file
i have also include the "global.h" file in other file where i am using the Token value how can i correct this problem.
Something weird that I've been seeing, a web application written in ASP.Net (C#) that got the source code on the production server and compile that way. So when I deploy to the server I deploy the source code.
Why does .Net have this functionality? Doesn't make sense.
I must say I really like the new code analysis with VS 2010, I have a lot of areas in my code where I am not using CultureInfo.InvariantCultureand code analysis is warming me about this.
I am pretty sure I want to use CultureInfo.InvariantCulturewhere ever code analysis has detected it is missing on Convert.ToString operations.
Is there anyway to get VS to automatically fix warnings of this type?
They usually involve generics. But some methods with generics don't have them, and not all extension methods have them.
They've just "been there" since day one, we've all seen them; but I realized I still don't know what they mean, and I can't find the answer anywhere. Now it's really bugging me. Google just turns up results that are about XML, etc.
Is this officially documented anywhere? Thanks.
EDIT: Well that's just great. Since I just created an account to make my first Stack Overflow post, to get an answer for this burning question; I'm not allowed to post my pretty Intellisense picture, or create a new tag "angle-brackets". I love Stack Overflow, but... what a welcome!
Maybe my problem is that they aren't actually called "angle brackets"... ??
Anyway, I guess if you really want to see my beautiful screenshot you could manually go to:
http://www.freeimagehosting.net/uploads/6a6c2f3268.png
Bump me up please so I can include it in the post, thanks. ;)
I am reading a book and I am not sure if its a mistake or I am misunderstanding the quote. It reads...
Nowadays every PC you can buy has
hardware that can render images with
at least 16.7 million individual
colors. Rather than have an array with
thousands of color entries, the images
instead contain explicit color values
for each pixel. A 24-bit display, of
course, uses 24 bits, or 3 bytes per
pixel, for color information. This
gives 1 byte, or 256 distinct values
each, for red, green, and blue. This
is generally called true color,
because 256^3 (16.7 million)
He says 1 byte is equal to 256 distinct values. 1 byte = 8 bits. 8^2 bits = 64 combinations of colors right ?? It's not adding up right to me. I know it might be something simple to understand, but I don't understand.
I have been parsing xml content using the xmlreader and cannot use the xml document but so far it works getting all elementcontent except for the attribute contents. I need to parse the link below found in the following entry;
<title>XXXX UUUUUU posted a</title>
<category term="NotePosted" label="Note Posted"/>
<link rel="alternate" type="html" href="http://www.dfsddsfdsf.com/profile.php?id=sdfdfsfdsdfddfsfd&v=wall&story_dbid=dssdfasdfdasfdsafafafa"/>
<source>......... <source>
I need the href tag in the link attribute but it keeps coming back null.
While ureader.Read
If ureader.HasAttributes Then
fId = ureader.GetAttribute("href")
If fId.Contains("?v=wall&") Then
fIdList.Add(fId)
Exit While
End If
If String.IsNullOrEmpty(fId) Then
fId = "NOTHING"
End If
End If
End While
At the moment, I've got a JSON file with content looking like this:
{
"username": "test",
"someNumber":100
}
I'm using JSON.Net to fetch the .JSON file from a webserver - C#:
var http = new HttpClient();
http.MaxResponseContentBufferSize = Int32.MaxValue;
var response = await http.GetStringAsync(URI);
var result = JsonConvert.DeserializeObject<DatClass.Result>(response);
This works great together with the class getting/setting the properties.
However, what I would like to know is whether there's a good way for a user to update the .JSON file through a textbox UI?
As in:
[textbox - update username] [update button] - username sent to server - .JSON file updated - [textblock - showing updated username in UI].
I'm not looking for exact code solutions, I'm rather looking for good solutions on this, and/or if this is a terrible idea of an easy database(?).
I am about to give up debugging SMTP servers to send email... My code is the following
private void SendMail()
{
SmtpClient mailClient = new SmtpClient("smtp.mail.yahoo.com", 465);
mailClient.EnableSsl = true;
MailMessage message = new MailMessage();
message.To.Add("[email protected]");
message.Subject = "i wish it would work";
MailAddress fromAddress = new MailAddress(Email.Text, Name.Text);
message.From = fromAddress;
mailClient.Send(message);
}
I am trying to make a simple server thread in QT to accept a connection, however although the server is listening (I can connect with my test app) I can't get the newConnection() signal to be acted on.
Any help as to what I'm missing here would be much appreciated!
class CServerThread : public QThread
{
Q_OBJECT
protected:
void run();
private:
QTcpServer* server;
public slots:
void AcceptConnection();
};
void CServerThread::run()
{
server = new QTcpServer;
QObject::connect(server, SIGNAL(newConnection()), this, SLOT(AcceptConnection()));
server-listen(QHostAddress::Any, 1000); // Any port in a storm
exec(); // Start event loop
}
void CServerThread::AcceptConnection()
{
OutputDebugStringA("\n***** INCOMING CONNECTION"); // This is never called!
}
I always find myself needing to enclose a block of code in curly braces { }, but unfortunately that isn't included in the C# surround code snippets, which seems to be an oversight. I couldn't find anything on building your own surround snippets either (just other kinds of snippets).
I am actually running Resharper too, but it doesn't seem to have this functionality either (or I haven't figured how to activate it).
We have a coding standard of including even a single line of code after an if or else in curly braces, so if I could just make Resharper do that refactor automatically that would be even better!
Hi Experts,
Who can help me with this: I am working on Win7 x64, with VS.net 2008. I am developping for pocketpc.
When my application is deployed to the device emulator it can't connect to my computer / db server. Both de emulator as well the mobile device center are configured to use DMA. When I cradle the device using device manager, nothing happens.
What can I try?
Greets,
Jasper
I've been playing around to see how my computer works under the hood. What I'm interested in is seeing is what happens on the stack inside a function. To do this I've written the following toy program:
#include <stdio.h>
void __cdecl Test1(char a, unsigned long long b, char c)
{
char c1;
unsigned long long b1;
char a1;
c1 = 'b';
b1 = 4;
a1 = 'r';
printf("%d %d - %d - %d %d Total: %d\n",
(long)&b1 - (long)&a1, (long)&c1 - (long)&b1,
(long)&a - (long)&c1,
(long)&b - (long)&a, (long)&c - (long)&b,
(long)&c - (long)&a1
);
};
struct TestStruct
{
char a;
unsigned long long b;
char c;
};
void __cdecl Test2(char a, unsigned long long b, char c)
{
TestStruct locals;
locals.a = 'b';
locals.b = 4;
locals.c = 'r';
printf("%d %d - %d - %d %d Total: %d\n",
(long)&locals.b - (long)&locals.a, (long)&locals.c - (long)&locals.b,
(long)&a - (long)&locals.c,
(long)&b - (long)&a, (long)&c - (long)&b,
(long)&c - (long)&locals.a
);
};
int main()
{
Test1('f', 0, 'o');
Test2('f', 0, 'o');
return 0;
}
And this spits out the following:
9 19 - 13 - 4 8 Total: 53
8 8 - 24 - 4 8 Total: 52
The function args are well behaved but as the calling convention is specified, I'd expect this. But the local variables are a bit wonky. My question is, why wouldn't these be the same? The second call seems to produce a more compact and better aligned stack.
Looking at the ASM is unenlightening (at least to me), as the variable addresses are still aliased there. So I guess this is really a question about the assembler itself allocates the stack to local variables.
I realise that any specific answer is likely to be platform specific. I'm more interested in a general explanation unless this quirk really is platform specific. For the record though, I'm compiling with VS2010 on a 64bit Intel machine.
When globalizing a wpf application with static resx classes, it's very easy to miss the odd label or button that has its Content property set to a hard coded string in a particular language, ie English. These should of course be moved off to a {x:Static ...} so they can be localised for each culture.
Are there any tools which can spot this and warn you? Built in to VS would be ideal, but I'm thinking that 'style cop' type build tools would do the job as well.
Is it possible to reference other projects' properties via a macro within a build event?
For example:
"Tool1" outputs to directory ..\..\bin\Release
"Component1" uses "Tool1" in its post-buildevent
To get to "Tool1", "Component1"'s project must do something like $(SolutionDir)bin\Release
This requires that Tool1 always output to ..\..\bin\Release. If this is changed this breaks the other project. I know there is no indication to this within the macro list but is there a way to reference another project? Maybe like $(OtherProject.TargetDir)...
I know WIX has a similar syntax [$(var.OtherProject.TargetDir)] but I think that may be a different mechanism.
At work we have a C# solution with over 80 projects. Is it possible in VS 2010 to stop compilation as soon as an error is encountered rather than the default behaviour which is to continue as far as possible and display a list of errors in the error window?
For example, I have some project Common.Utils.csproj and use it in all other projects. I can store its (Utils) sourses in one repository and modify it only there, register dll in gac and use it as dll in other projects, or I can clone sourse anywhere I need, include project in solution, use it as source and push modifications. So, what is best practice?
HI, Just ran into a problem. How to I change a picturebox's picture from within a different header file.
If I do it in the same .h file as the Form I am working on I use:
sq1-Image = bi; (which loads in a bitmap)
but when I do it from another header (i've included the correct header file), I get
"sq1 is an undeclared identifier"
and
"left of '-image' must point to a class/struct/union/generic"
What I'm looking for is something like
Form1::sq1-Image = bi;
Basically I just want to point the program to change picturebox from another location....Is this possible? How can I do this?
Cheers!
I tried http://code.google.com/p/feed-reader-lib but holy cow, talk about difficult to build. It has a nightmare of dependencies on Xerces and Xalan, both of which seem to be choking under the new VisualStudio 2010 C++ compiler. I've wasted hours trying to build this thing which is a shame. Does anyone have anything a little easier to hit the ground running with?
Hi, I would like to ask for a recommendation on offline form format which user can bring around. Once done, they will upload the file to the server and data will be extracted from there.
We are currently looking at Word and Excel 2003 since all users have it on their machine but it seems that using interops on server is something to avoid.
Suggestions?
I'm writing an application which has two classes that provide basically the same functionality but for different situations. I'd like to have three versions of the software - one where the user can change an ini file to configure the program to use one of the two classes, and then one version that only uses one of the two classes.
Right now I have it working via an ini file, but I'd like to be able to build versions that don't include the code for the unneeded class at all.
What is the best way to go about this? My current line of thinking is that since both classes derive from a common interface I'll just add a compile time conditional that looks at the active build configuration and decides whether to compile that class. What is the syntax to do that?
Thanks in advance for your help and input!