|
He's just been keeping his eyes shut.
|
|
|
|
|
wide shut probably.
Luc Pattyn [Forum Guidelines] [My Articles] Nil Volentibus Arduum
Please use <PRE> tags for code snippets, they preserve indentation, improve readability, and make me actually look at the code.
|
|
|
|
|
thanks for your answer
i don't have anay bug with this code but when i run it the return value of getChromeURL is null i don't know why !!!!
PS: great article
|
|
|
|
|
you're welcome.
moums wrote: the return value of getChromeURL is null i don't know why
if you read the article you should know by now. If it still fails, you should compare what you have with what I offered, and if that doesn't help, you might post the relevant part of your code here.
Luc Pattyn [Forum Guidelines] [My Articles] Nil Volentibus Arduum
Please use <PRE> tags for code snippets, they preserve indentation, improve readability, and make me actually look at the code.
|
|
|
|
|
wooooooooooooow it's working now
thx a lot Luc for everything .............
see u nxt..... may be for an other question
take care...
|
|
|
|
|
Good observation Luc. Moreover the OP is responding to the replies. Not like "fire and forget" way.
|
|
|
|
|
I searched and found this post, but if I understand this correctly it will not work in my situation
http://www.codeproject.com/Messages/1907458/Re-Big-html-string-How-to-store-them.aspx[^]
How can I set a long string with multiple quotes inside of it to a single string variable? I want to hard code this so I can do a string replace. Thanks for reading!
An example would be
string htmltoreplace1 = @"<img src="/_layouts/images/blank.gif" class="ms-hidden" border=0 width=1 height=1 alt="Use SHIFT+ENTER to open the menu (new window)."></A><IMG SRC="/_layouts/images/blank.gif" ALT="" BORDER=0><IMG SRC="/_layouts/images/blank.gif" BORDER=0 ALT=""></TD><TD style="position:absolute;"><IMG src="/_layouts/images/blank.gif" width=13px style="visibility: hidden" alt="">"
or
string htmltoreplace2 = @" <TABLE width="100%" cellspacing=0 cellpadding=0 border=0><SCRIPT>
ctx = new ContextInfo();
ctx.listBaseType = 0;
ctx.listTemplate = 100;
ctx.listName = "{5B7B0FEE-FE98-4066-A4FB-F48DF04D4EBA}";
ctx.view = "{79DA2D89-70D6-4497-90D9-DDE74040EF88}";
ctx.listUrlDir = "\u002fdcs\u002fotso\u002fDSUSF\u002fISSBR\u002fdeddDIB\u002fws\u002fLists";
ctx.HttpPath = "\u002fdcs\u002fotso\u002fDSUSF\u002fISSBR\u002feDIB\u002fws\u002f_vti_bin\CS=65001";
ctx.HttpRoot = "http:\u002f\u002.comb\u002fdcs\u002fotso\u002fDSUSF\u002fISSBR\u002fddeDIB\u002fws";
ctx.imagesPath = "\u002f_layouts\u002fimages\u002f";
ctx.PortalUrl = "http:\u002f\u002.com\u002fdcs\u002f";
ctx.SendToLocationName = "";
ctx.SendToLocationUrl = "";
ctx.RecycleBinEnabled = -1;
ctx.OfficialFileName = "";
ctx.WriteSecurity = "1";
ctx.SiteTitle = "Windows Support";
ctx.ListTitle = "Windows Shift Rotation";
if (ctx.PortalUrl == "") ctx.PortalUrl = null;
ctx.displayFormUrl = "\u002fdcs\u002fotso\u002fDSUSF\u002fISSBR\u002fdeddbDIB\u002fws\u002fLists\u002fDispForm.aspx";
ctx.editFormUrl = "\u002fdcs\u002fotso\u002fDSUSF\u002fISSBR\u002feDIB\u002fws\u002fEditForm.aspx";
ctx.isWebEditorPreview = 0;
ctx.ctxId = 3;
g_ViewIdToViewCounterMap[ "{79DA2D89-70D6-4497-90D9-DDE74040EF88}" ]= 3;
ctx.CurrentUserId = 9341;
ctx3 = ctx;
</SCRIPT>"
modified on Friday, January 28, 2011 1:39 PM
|
|
|
|
|
use the backslash:
string str = "This is a string with \"quotes\" in it";
the other option is to "double up" the quotes and use the @ modifier
string str2 = @"This is a string with ""quotes"" in it";
"If your actions inspire others to dream more, learn more, do more and become more, you are a leader." - John Quincy Adams
|
|
|
|
|
It is possible that I have misunderstood you, but this does seem a little simple:
If I understand you correctly, all you need to do is include the double quote characters in your string:
string s = @"1""2""3"; would create a string containing 5 characters:
'1'
'"'
'2'
'"'
'3'
So would:
string s = "1\"2\"3"; Take your pick!
If the string is quite large and unwieldy, and you want to include the newlines as well, you could make it more readable by moving the text to a file, and including it in your resources.
Real men don't use instructions. They are only the manufacturers opinion on how to put the thing together.
|
|
|
|
|
It did seem simple until I tried to do it
Some of the strings are very very long, so I will have to move it to another file I guess.
Thank you both for your replies.
|
|
|
|
|
Hi,
I would like to implemnet a process that will initial on every form on my application on form InitializeComponent...
My thought is to some how customize the Form class and inherite the new class as my Form
i.e. "public class Form1 : MyCustomizedForm"
But I don't wont to recreate to whole Form class, I only whant to implement a process on it's loading after all controls were added. But I need it to take place in every form on my application.
Any ideas?
tnx
|
|
|
|
|
So, all you want to do is have something like this:
public class MyCustomizedForm : Form
{
public MyCustomizedForm() : base()
{
}
}
|
|
|
|
|
I think your talking about creating a class that inherits from system.windows.forms.form. Then in each of your form's designer's change the inheriting from system.windows.forms.form to this new class. Put code in the new class and each form gets that code?
if not -> need clarification with what your trying to do.
'Never argue with an idiot; they'll drag you down to their level and beat you with experience.' ~ anonymous
|
|
|
|
|
Guys,
I have implementing small academic project can any one let me know some of the Free SMS API's. so that i can use them in my project... please i am trying to do some thing realistic and its a big challenge for me... Thanks in Advance..
|
|
|
|
|
|
HI all,
How can i clear IE history with c#
Thanks
Rakesh
|
|
|
|
|
Don't repeat. You have already asked this in the Q&A section
I know the language. I've read a book. - _Madmatt
|
|
|
|
|
Repost: Already asked in Q&A.
Don't post in multiple places, all that happens is you annoy people, duplicate effort, and waste time.
It can reduce your chances of getting an answer...
Real men don't use instructions. They are only the manufacturers opinion on how to put the thing together.
|
|
|
|
|
Ok, so here is the problem. I got native dll which contains and utilizes my own class for building dynamic string arrays. Here is a simple example how it works in C(++):
wchar_t **GetArray()
{
ArrayBuilder *arrb = new ArrayBuilder();
arrb->Append(L"test1");
arrb->Append(L"test2");
arrb->Append(L"test3");
return arrb->GetArray();
}
wchar_t **myarray = GetArray();
wprintf(L"Element1: %s, element2: %s and element3: %s\r\n", myarray[0], myarray[1], myarray[2]);
Assuming that i am exporting this small test function "GetArray" from dll:
extern "C" { __declspec(dllexport)wchar_t **GetArray() }
How can i get this string array in my C# app? I have tried something like:
[DllImport("db.dll", CharSet = CharSet.Unicode, SetLastError = true)]
public static extern List<String> GetArray();
or
public static extern String[] GetArray();
or
public static extern Array GetArray();
Nothing works. It throws that it "cannot marshal return value: Generic types cannot be marshaled", or, in case of last approach, some HRESULT error. So in fact i have missed something, but what? What is the right way to call this function in C# app?
Thanks
011011010110000101100011011010000110100101101110
0110010101110011
|
|
|
|
|
Alright, i got it.
[DllImport("db.dll", CharSet = CharSet.Unicode, SetLastError = true)]
public static extern IntPtr GetArray();
IntPtr test = dbFunc.GetArray();
StringBuilder zzz = new StringBuilder();
int i = 0;
for (; ; )
{
IntPtr p = new IntPtr(test.ToInt32() + Marshal.SizeOf(typeof(IntPtr)) * i++);
IntPtr stuff = Marshal.ReadIntPtr(p);
if (stuff == IntPtr.Zero) break;
string s1 = Marshal.PtrToStringAuto(stuff);
zzz.Append(s1 + ",");
}
MessageBox.Show(zzz.Remove(zzz.Length - 1, 1).ToString());
011011010110000101100011011010000110100101101110
0110010101110011
|
|
|
|
|
What should I use as a rule of thumb for being able to tell when it's time to break a large class into two?
I know that a class should have only one responsibility, but sometimes it's hard to tell.
The difficult we do right away...
...the impossible takes slightly longer.
|
|
|
|
|
That's the question of the ages! I don't really have a good answer for you. One criteria is if the methods / fields / properties seem unrelated then group the related ones into separate classes.
"If your actions inspire others to dream more, learn more, do more and become more, you are a leader." - John Quincy Adams
|
|
|
|
|
Thanks. Does that imply that if they are closely related, then it doesn't matter how big the class gets?
The difficult we do right away...
...the impossible takes slightly longer.
|
|
|
|
|
not necessarily, you just need to use a more refined meaning of "closely related"
"If your actions inspire others to dream more, learn more, do more and become more, you are a leader." - John Quincy Adams
|
|
|
|
|
Different developers will have different ideas so like most things I do, just make sure you have a good argument to do it so when other members question why you did it, you have an answer.
For me, I start looking at redesigning a class when its over 10,000 - 15,000 lines.
Architecture is extensible, code is minimal.
|
|
|
|