|
Hii All!
I have created an application using Vb.net......Now I want to make its installer with Install Shield. I want the installer to check whether the .Net Framework is installed, if not then install it. I need to know that what kind of scripting is required to achieve it.
Regards
_mubashir
Marriala Technologies,
Pakistan
|
|
|
|
|
Search the MSDN for Bootstrapping the NET Framework. They have C++ source code that you can use as an example of how to check this. You should be able to convert that into Install Script, because is is essentially a "C" language.
|
|
|
|
|
Hi folks,
The following piece of C#.NET code creates an A4 size binary image by reading values from a two-dimensional byte array iPage[][].
Is there anyway I can further optimize the nested for loop inside the unsafe block? It is taking ~2.2s, and I'd love to bring it down further.
Sarab.
// page dimensions
iwd=iPage.Length;
iht=iPage[0].Length;
// create new bitmap
bMap=new Bitmap(iwd, iht, PixelFormat.Format24bppRgb);
// create bitmap data
bData=bMap.LockBits(new Rectangle (0,0,iwd,iht),ImageLockMode.WriteOnly,PixelFormat.Format24bppRgb);
// get bitmap position
Scan0 = bData.Scan0;
iStride=bData.Stride;
unsafe
{
// initialize pointer
byte *p = (byte*)(void*)Scan0;
int nOffset = iStride-iwd*3;
for(int y=0;y<iht;++y)
{
for(int x=0;x<iwd;++x)
{
if (iPage[x][y]==0) p[0]=p[1]=p[2]=255;
else p[0]=p[1]=p[2]=0;
p += 3;
}
p += nOffset;
}
}
PS. the code above is inspired from the article(s): http://www.codeproject.com/cs/media/csharpgraphicfilters11.asp
|
|
|
|
|
It looks like that about as fast as your going to get it without resorting to writing the thing in Managed C++.
Whoops! Accidently clicked Submit...
If you can come up with an algorithm to get rid of that if statement, you'll probably cut the time in half.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
-- modified at 18:01 Tuesday 27th September, 2005
|
|
|
|
|
hmm... not so confident in managed c++.. can't remove the if statement either!
thanks anyways...
|
|
|
|
|
What values does the byte array contain? Do you only swap 0 <-> 255 or does the byte array contain different values?
When it contains only 0 or 255, you can use p[0]=p[1]=p[2]=~iPage[x][y];
How do you create the iPage array? If you could swap it to be iPage[y][x], you could evaluate iPage[y] outside the inner loop. (byte[] thisRow = iPage[y] and then continue to use the inner loop).
Also, you might want to eliminate bounds checking on iPage array access by using a foreach loop (it looks slower, but the C# compiler generates special code (no bounds checking) when foreach is used on an array).
So propably this could be faster: (provided you swap x and y in your array creation and use only the values 0 and 255):
foreach (byte[] row in iPage) {
foreach (byte val in row) [
p[0] = p[1] = p[2] = ~val;
p += 3;
}
p += nOffset;
}
|
|
|
|
|
Thanks Daniel!
Redefining my array as iPage[y][x] and using the foreach loop worked wonders! The execution time's safely within the acceptable range now
Thanks !!!
|
|
|
|
|
Hi
I'm working on a solution containing 10-15 projects that generate DLLs.
Some projects use DLLs generated by other projects, I solve this by setting dependcies...
All DLLs are generated in one location.
No local copies are made when building the DLLs
For some reason, .NET hangs on to some of the DLL files (the .NET process) thus dening me from replacing them with new ones. From the 10-15 projects there are 2-3 DLLs being held as "open", even if no build\debug in process.
I solve this by exiting .NET, deleteing the DLLs and rebuilding them.
Any solution ?
Gilad.
|
|
|
|
|
Hello folks,
I wish to write text on an Image in .NET
I figure I can use the Graphics.drawString() method to do so, but it turns out that .NET would only allow me to write on images with non-indexed pixel formats.
The format I'm now using is 1bppIndexed, which allows me to keep the size of these image objects limited. I do not wish to change these images to a non-indexed pixel format like 24bppRGB (even though that allows me to draw text on the image), 'cause here I'm only dealing with binary images, each around 3500pixels by 2480pixels.
Since a format like 24bppRGB occupies much more space than what is required, I was hoping there would be a way to write on the 1bppIndexed images directly.
Any ideas?
Thanks...
|
|
|
|
|
If you're using 1bpp images, that's plain black and white. Truetype fonts require more color depth to perform antialiasing, so that won't work. You can go three ways IMO:
- render the font to a transparent image, convert to black & white and overlay over the original image, possibly creating a jagged font
or
- convert the image to more bpp, then render the text on top of it, then convert back to b&w. Will use a lot of memory for the converted image.
or
- use a bitmapped font that you can directly add to the image by using SetPixel()
Good luck..
|
|
|
|
|
Oops I overlooked the 1bpp INDEXED, so not black & white, but the same solutions apply IMO.
|
|
|
|
|
Understood the anti-aliasing part..
But didn't quite understand your first suggestion..
As for your second suggestion, I figure it doesn't solve the memory problem..
Guess will take a shot at attempting your third suggestion though...
Thanks...
Sarab
|
|
|
|
|
Hi,
Strange behaviour with a System.Net.Sockets.Socket, reproducable on 95, 2000
and XP
If I reuse a socket object after initializing it I can reconnect without
problems.
But
If the application has been running for 23 minutes or longer, the socket
will forever
wait for BeginConnect() to finish.
If I use a Connect() (also after 23 minutes) instead of async connecting the call will block
forever.
I am using the following (pseudo) code to test. If running this after 23
minutes, the connect fails
and it is impossible to reconnect without restarting the application.
Is this known behaviour? Is there a workaround? Am I making a mistake? Help would be greatly
appreciated. For the time being I dropped a winsock control on a form and use that as my async socket.
regards
Guido
this is the offending code:
<br />
class SocketConnector<br />
{<br />
AsyncCallback m_callback = null;<br />
System.Net.Sockets.Socket m_socket = null;<br />
bool m_connected = false;<br />
public bool Connected<br />
{<br />
get { return m_connected; }<br />
}<br />
public void Connect(string ipaddress, int port)<br />
{<br />
m_callback = new AsyncCallback( OnConnect );<br />
<br />
m_socket = new Socket (AddressFamily.InterNetwork,SocketType.Stream <br />
,ProtocolType.Tcp );<br />
m_socket.Blocking = false;<br />
<br />
IPAddress ip = IPAddress.Parse (ipaddress);<br />
int iPortNo = System.Convert.ToInt16 ( port);<br />
<br />
IPEndPoint ipEnd = new IPEndPoint (ip,iPortNo);<br />
<br />
IAsyncResult ar = m_socket.BeginConnect( ipEnd, m_callback, m_socket );<br />
<br />
ar.AsyncWaitHandle.WaitOne(2000,false);<br />
<br />
if (!ar.IsCompleted || m_callback!=null)<br />
{<br />
m_connected = false;<br />
return;<br />
}<br />
m_connected = true;<br />
}<br />
void OnConnect(IAsyncResult result)<br />
{<br />
m_callback = null;<br />
}<br />
} <br />
<br />
|
|
|
|
|
What API can be used to extract data from MS Project with?
Thanks...
|
|
|
|
|
Hi All!
I use XmlSerializer to serialize object and got the following:
<?xml version=\"1.0\" encoding=\"utf-16\"?>
<MyClass xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xmlns=\"http://www.MyFirma.biz/MyNamespace\">
<Positions>
<Position>
</Position>
...
</Positions>
</MyClass>
Is it possible to get rid of the overhead (namespace info, schema info, xml version)? Anyway I do not need this info since parsing will be done without XmlSerializer.
So I need that output looks like below:
<MyClass>
<Positions>
<Position>
</Position>
...
</Positions>
</MyClass>
Thanks!
|
|
|
|
|
Hi,
how can I find Text with specific BackColor in my RTB and replace it with another BackColor ? I do not know the Text, Startposition, Length and number of the text pieces with the specific BackColor.
Thanks
Lupus
|
|
|
|
|
Sorry,
I put my question in the wrong section of this forum.
I'll repeat my question in the section "Visual Basic / VB.NET"
Lupus
|
|
|
|
|
What is difference between IL and MSIL in Dot.net FrameWork.
Regards
Rajesh
rajesh
|
|
|
|
|
As much as I know both are the same in dot net
where as IL is a more generic term Java Byte Code is an IL
any code that runs in some kind of a virtual environment is an IL
Regards,
Saqib Shakil
|
|
|
|
|
In the .NET Framework, IL is MSIL. It's Microsoft Intermediate Language.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
HI all,
I need some information regarding stack trace of the .net framework.
As we know,when ever an exception occurs some details will be shown in the stack trace.
In my project we have a system to lock the exact exception occured ..
using like this
Exception e;
e.InnerMessage;
I am using exception handling (try,catch,finally) in my development.
These details will be stored in some error log folder as files per each day.
My request is ...
1.)In which are the situations we will use stack trace related details in coding.
2.)Can i use the stack trace details for my project scenario more effectively than the existing system. If so pls give me details how can use that.
Thanks in advance,
Deepu
|
|
|
|
|
I have intalled .Net Framework 1.1 With SP1 on my test PC which is Running on Windows XP Home Edition and Windows 2000 Professional. My app crashes with some unknown Exception. I have tried a simple Windows App with just a few default controls it still doesnt work.
Error Shows
Common Language Runtime Debugging Services
Application Has Generated an exception that could not be handled
ProcessID = 0x128(288) ThreadID= 0x546(???)
What could be wrong with it
I have tried Both debug and release versions
Zishan Haider
|
|
|
|
|
You mention both XP and 2000 on your machine. Are you sure that the .NET framework is installed on the one you are using for the tests? If not, it will fail.
Another possibility is that the assembly is not running under the proper security credentials (e.g. running from a network drive without sufficient trust set for the intranet zone).
...Steve
|
|
|
|
|
The test systems did not have .net framework installed prevously. I installed it by running that 23MB framework file only. I even installed the SP1 after the framework installtion. And no.. The test system is isolated, i.e. not connected through any network. I am running it through the local hard drive. What else can be wrong?
Regards...
|
|
|
|
|
The framework is not correctly installed or you are targetting the wrong version of the framework in your assembly.
...Steve
|
|
|
|