|
Okay, my memory failed me slightly. It must have been one of my other experiments that returned the name of my executable. However, I did try the one you suggested and it didn't return anything obviously useful either. It returned the following two strings:
PhdBetaInstall.g.resources
PHDInstallation.Properties.Resources.resources
What am I supposed to do with those? I want strings returned like this:
Resources/InterestingFile1.dll
Resources/InterestingFile2.dll
etc. etc. To get those, I'd have two DLL's embedded with the specified names. Now maybe you can tell me what I'm supposed to do with the two strings that GetManifestResourceNames() did return that would produce what I want. But the MSDN reference you provided wasn't very helpful and I'd found it and tried it before starting this thread.
The code that produced the two strings from GetManifestResourceNames() is the following:
Assembly assembly = Assembly.GetExecutingAssembly();
string[] resourceNames = assembly.GetManifestResourceNames();
|
|
|
|
|
code such as:
Module module=type.Module;
Assembly assembly=module.Assembly;
log("Embedded resources for assembly "+assembly.ToString());
string[] sa=assembly.GetManifestResourceNames();
foreach (string s in sa) log(" "+s);
shows a list of embedded resources, i.e. data structures that reside inside an EXE or DLL (in this case the one holding the definition for Type type). The result could be:
Explorer.resources.winLP.jpg
Explorer.resources.LPExplorer.ico
Such information can be used like so to instantiate an object:
Bitmap bitmap=new Bitmap(type, resourceName);
Icon icon=new Icon(type, resourceName);
One way of getting such resources into your EXE/DLL file is by adding image/icon/whatever files to your solution, then setting their "Build Action" property to "Embedded Resource".
Your solution might contain other files as well, those would not become resources and not be listed by GetManifestResourceNames(). EXE and DLL files themselves are not considered resources. Also, you can add any file you want to a solution, even ones not needed for a successful build; and the resulting EXE/DLL typically does not know at all what files were used to get built.
|
|
|
|
|
Just a quick reply to this. I'll get back to a full response to your post later. I just want to note that it is precisely EXE and DLL files that I'm adding to my Resources folder that I want to export, because I'm "rolling my own" installation program, and the installation program has all the installation files of the application being installed embedded as resources so that I can distribute a single executable file that exports all the DLL and EXE files to the installation folder of the application being installed. So I'm not sure how this relates to this statement of yours. Perhaps you can elaborate:
Luc Pattyn wrote: EXE and DLL files themselves are not considered resources.
|
|
|
|
|
I use the following code :
mem.udt_PhonebyMemIDandContactType(memID, null, Txt_MobileNum.Text, null, 4, null);
the value of Txt_MobileNum.Text is unreachable because of the error "Cannot evaluate expression because a thread is stopped at a point where garbage collection is impossible, possibly because the code is optimized."
what is it for? what should i do?!!
|
|
|
|
|
you could Google your error message, which yields many including this one[^], it is a slow starter however the end looks interesting.
|
|
|
|
|
Hi Guys,
we've been running into some kind of strange trouble recnetly and not luck till now.
Ther error is coming only in one dev. machine out of 3. all have the same version of softwares and using TFS for version control.
For unit testing our modules containg NServiceBus code, we are using NServiceBus unit testing framework.
the code is like
<br />
[TestMethod]<br />
public void SomeMethod(Assembly asm)<br />
{<br />
...<br />
NServiceBus.Testing.Test.Initialize(asm);
...<br />
}<br />
the error message
Test method Decos.Kcs.UnitTests.Handlers.CaseHandlers.Dummy.AllCaseHandlerTest.TestSearchCaseHandler threw exception: System.BadImageFormatException: Could not load file or assembly 'file:///C:\Program Files\Microsoft Visual Studio 9.0\Common7\IDE\devenv.exe' or one of its dependencies. The module was expected to contain an assembly manifest..
the stack trace is
System.Reflection.Assembly._nLoad(AssemblyName fileName, String codeBase, Evidence assemblySecurity, Assembly locationHint, StackCrawlMark& stackMark, Boolean throwOnFileNotFound, Boolean forIntrospection)
System.Reflection.Assembly.nLoad(AssemblyName fileName, String codeBase, Evidence assemblySecurity, Assembly locationHint, StackCrawlMark& stackMark, Boolean throwOnFileNotFound, Boolean forIntrospection)
System.Reflection.Assembly.InternalLoad(AssemblyName assemblyRef, Evidence assemblySecurity, StackCrawlMark& stackMark, Boolean forIntrospection)
System.Reflection.Assembly.InternalLoadFrom(String assemblyFile, Evidence securityEvidence, Byte[] hashValue, AssemblyHashAlgorithm hashAlgorithm, Boolean forIntrospection, StackCrawlMark& stackMark)
System.Reflection.Assembly.LoadFrom(String assemblyFile)
NServiceBus.Configure.GetTypesInDirectoryWithExtension(String path, String extension) in d:\BuildAgent-03\work\672d81652eaca4e1\src\config\NServiceBus.Config\Configure.cs: line 211
d__3.MoveNext() in d:\BuildAgent-03\work\672d81652eaca4e1\src\config\NServiceBus.Config\Configure.cs: line 173
ctor(IEnumerable`1 collection)
NServiceBus.Configure.With() in d:\BuildAgent-03\work\672d81652eaca4e1\src\config\NServiceBus.Config\Configure.cs: line 79
NServiceBus.Testing.Test.InitializeInternal() in d:\BuildAgent-03\work\672d81652eaca4e1\src\testing\Test.cs: line 38
NServiceBus.Testing.Test.Initialize(Assembly[] assemblies) in d:\BuildAgent-03\work\672d81652eaca4e1\src\testing\Test.cs: line 30
TResponseMessage]() in D:\Kanu\Projects\KCS\Sources\Decos.KCS\Development\Decos.Kcs.UnitTests.Handlers.CaseHandlers.Dummy\AllCaseHandlerTest.cs: line 102
Decos.Kcs.UnitTests.Handlers.CaseHandlers.Dummy.AllCaseHandlerTest.TestSearchCaseHandler() in D:\Kanu\Projects\KCS\Sources\Decos.KCS\Development\Decos.Kcs.UnitTests.Handlers.CaseHandlers.Dummy\AllCaseHandlerTest.cs: line 73
The output window contents on the error machine is
The Test.Initialize() methos fails on that specific machine.
While on other machine, it just does not look for devenv.exe.
It just continues with loading NServiceBus.Host and other dlls.
We have cross checked the referneces of the projects and everything seems to be fine.
any help is appreciated.
Thanks
|
|
|
|
|
tijujohn83 wrote: The output window contents on the error machine is
you may want to look into your post and possibly fix some HTML tag look-alikes.
|
|
|
|
|
Got the issue.
installed visual studio 2008 sp1 and it got fixed.
Thanks.
|
|
|
|
|
Suppose i am writing code in .net e.g
int i=10
then .net show me red line under the code where error occurs.we know the i have not apply semicolon at the end of syntax(int i=10;)
who handles these error while writing the source code???.
|
|
|
|
|
Visual Studio IDE
Arindam Banerjee
Sr. Software Developer
Rance Computer Pvt Ltd.
Kolkata (India)
|
|
|
|
|
Do not spam the forums. Pick one and stick with it.
I know the language. I've read a book. - _Madmatt
|
|
|
|
|
I am trying to create a bitmap after using capCreateCaptureWindow and capPreview. The video appears in the picture box but I can't seem to save the bitmap using capFileSaveDIB (which returns true after calling it - file does not appear in the directory).
I can successfully save the image to the clipboard but was not successfull in saving the contents to a bitmap.
I am using visual c++ 2008 express edition, and therefore have no MFC library.
Any suggestions would be greatly appreciated!
|
|
|
|
|
In my webpage iam having the text '2nd number of passcode' where this number is changing dynamically each time when the page loads. And based on this number we need to select the value from the combo box (having 0 to 9). Is there any way that we can get the number in that label so that i can assign the number respective to the combo box. (both label number and combo box number value remains same)
Is this possible in visual studio 2010 coded ui automation testing?
|
|
|
|
|
jaimo wrote: this number is changing dynamically each time when the page loads.
Where is it coming from? Magic?
jaimo wrote: Is there any way that we can get the number in that label
Ask the magician who created it.
I know the language. I've read a book. - _Madmatt
|
|
|
|
|
Needs further explanation bro!!
|
|
|
|
|
G. S. Doiphode
Asst Prof
Applied Mechanics Department
Faculty of Technology & Engineering
The M. S. University of Baroda
Baroda
Gujrat State
Dear Sir
As i have read the your complete resume during surfing internet while searching a link between Vb6 and Matlab. Let me introduce, Myself teaching faculty at M. S. University of Baroda, to UG and PG students since last 13 years. The subjects are structural dynamics,theory of plates and shells,numerical methods and structural analysis.As, I am pursuing my Ph.D( Structural Engineering) in which i have my input file in Vb6 and the processor program that. I have developed in past in Matlab6.5 before 4 months, now it's somehow more difficult to convert the matlab program into Vb and work as single platform.
So, since last few days, I am in search of linking those two softwares,i.e., using vb6 can i run the all the function s of Matlab command line. I have read the matter in help file i.e., regarding development of COM file etc... but does'nt work that much.
See if you can help me in this line
thanking you
G. S. Doiphode
Baroda
09427331516
|
|
|
|
|
|
Pursuing a PhD, but yet you have absolutely no clue what the purpose or functionality of a forum envrionment is.
|
|
|
|
|
Hi all,
I am working on a feature where in we can allow/disallow changing system time to any user. We can run this application from an administrator's account and set if a particular user can change system time or not. Even the administrator (who itself is logged on) itself can allow/disallow himself changing time.
While googling I found that there is some, The system user right SeSystemtimePrivilege that controls the ability to set the system time. I could not find how to complete my feature via the privilege SeSystemtimePrivilege using C#.
Can somebody help me how to that using c# (or even C++). Even if there is some other way of implementing this feature, please let me know.
Thanks in Advance
Best Regards
Aseem
|
|
|
|
|
You have posted exactly the same question in C/C++/MFC forum (here[^]) and in System Admin forum (here[^]).
I know that sometimes it is hard to determine the best forum for a given question, but it is not a good idea to post the same question to multiple forums. Try to choose the most appropriate forum for your questions.
Please read the forum rules[^].
|
|
|
|
|
Hello,
I'm having troubles with Control.PointToScreen Method. I need to move mouse over controls center and then click on it. I am doing something like this:
Point aP = theControl.PointToScreen(new Point(theControl.Width / 2, theControl.Height / 2));<br />
MouseClick(aP);<br />
I have two monitors. When I select as primary monitor first one, it works fine. Mouse is moved correctly over center of control and clicked. When I select as primary monitor second one, mouse is not moved to the center of control, but elsewhere in the form. I need to have the same behavior on the both screens. Does anybody know what is the problem here?
Thanks in advance,
noIdea77
|
|
|
|
|
Please do not post the same question to multiple forums. It generally will not help you get an answer any faster and will make it more difficult for other people to find the correct answer.
Although this is the original post, the post found here[^] has more activity on it and should be used instead.
Scott Dorman Microsoft® MVP - Visual C# | MCPD
President - Tampa Bay IASA
[ Blog][ Articles][ Forum Guidelines] Hey, hey, hey. Don't be mean. We don't have to be mean because, remember, no matter where you go, there you are. - Buckaroo Banzai
|
|
|
|
|
I have a MustInherit class A, something like
Public MustInherit Class A
Protected A as Integer
Public Sub New(ByVal X As Integer)
A=X
End Sub
Public MustOverride Sub B()
End Class
and I want the declared constructor to be used for any derived classes. However, in derived classes, like
Public Class D
Inherits A
Public Sub B()
A+=2
End Sub
End Class
VS gives me an error, saying that there is no constructor in A that can be called without any arguments. Is there any way I can inherit the constructor?
~ Soumya92
|
|
|
|
|
Soumya92 wrote: VS gives me an error, saying that there is no constructor in A that can be called without any arguments.
Let's add that constructor then, and override the B sub;
Public Class D
Inherits A
Public Sub New(ByVal X As Integer)
MyBase.New(X)
End Sub
Public Overloads Overrides Sub B()
A = A + 2
End Sub
End Class
I are Troll
|
|
|
|
|
If class D inherits From Class A and Class A has no paramterless constructor, then you have to have a constructor with at least the same signature as the original constructor and call MyBase.New(X). Your class D can have more parameters but one has to be an integer, which must be passed to the original constructor. If you think about it, it makes sense as you need to create an instance of both classes to create an instance of Class D.
|
|
|
|